Re: [boost] Code question on fusion tag_of.hpp

Mathias Gaunard wrote:
On 08/08/2012 23:39, Dave Steffen wrote:
Hi Folks
During a recent bug hunt, we came across the following (Boost 1.49, fusion/adapted/std_tuple/tag_of.hpp):
#include <tuple>
namespace std { template <typename... Elements> class tuple; }
We find this rather puzzling -- why is this here? As far as we can tell, this doesn't do anything.
It forward declares std::tuple so that it can specialize its traits for it.
But it really shouldn't do that, since there is no guarantee this declaration is compatible with the standard one.
Well, first of all, it's not a forward declaration, right? std::tuple is declared in whatever gets included with #include<tuple>, right? So it's not a forward declaration, it's a... what? A backwards declaration? :-) It's redundant at any rate. (Or I'm completely wrong, in which case I'm missing something.) And then, yes, this may or may not be compatible with the real std::tuple (which is what we were looking in to when we found this). -- Dave Steffen Software Engineer NUMERICA CORPORATION www.numerica.us (970) 461-2000 main (970) 612-2327 direct

On 09/08/2012 18:04, Dave Steffen wrote:
And then, yes, this may or may not be compatible with the real std::tuple (which is what we were looking in to when we found this).
I suppose it's not compatible with that of libc++ and for libraries that are not C++11 aware on C++03 compilers. I suggest you file a ticket on the bug tracker.

On 08/09/2012 10:15 AM, Mathias Gaunard wrote:
On 09/08/2012 18:04, Dave Steffen wrote:
And then, yes, this may or may not be compatible with the real std::tuple (which is what we were looking in to when we found this).
I suppose it's not compatible with that of libc++ and for libraries that are not C++11 aware on C++03 compilers.
I suggest you file a ticket on the bug tracker.
Done: https://svn.boost.org/trac/boost/ticket/7217 Thanks very much. (BTW, am I right in thinking that the fwd declaration is redundant?) -- Dave Steffen Software Engineer NUMERICA CORPORATION www.numerica.us (970) 461-2000 main (970) 612-2327 direct

On 8/10/2012 1:13 AM, Dave Steffen wrote:
On 08/09/2012 10:15 AM, Mathias Gaunard wrote:
On 09/08/2012 18:04, Dave Steffen wrote:
And then, yes, this may or may not be compatible with the real std::tuple (which is what we were looking in to when we found this).
I suppose it's not compatible with that of libc++ and for libraries that are not C++11 aware on C++03 compilers.
I suggest you file a ticket on the bug tracker.
Done: https://svn.boost.org/trac/boost/ticket/7217
Thanks very much.
(BTW, am I right in thinking that the fwd declaration is redundant?)
FYI, this has already been fixed some months ago. Yes, it is wrong and it is redundant. Regards, -- Joel de Guzman http://www.boostpro.com http://boost-spirit.com
participants (3)
-
Dave Steffen
-
Joel de Guzman
-
Mathias Gaunard