Boost logo

Boost :

Subject: Re: [boost] [Review] Type Traits Introspection library by Edward Diener starts tomorrow Friday 1
From: Edward Diener (eldiener_at_[hidden])
Date: 2011-07-05 16:09:30

On 7/5/2011 4:38 AM, John Maddock wrote:
> OK here's my review of this library.
> I see that this static assertion fails:
> BOOST_STATIC_ASSERT((boost::tti::has_comp_member_function_begin<std::vector<int>::const_iterator
> (std::vector<int>::*const)(void)>::value));

Investigating this I find out that the form that function_types
generates, which is what BOOST_TTI_HAS_MEMBER_FUNCTION uses, is:

std::vector<int>::const_iterator (std::vector<int>::* )() const

so that:


(std::vector<int>::*)(void) const>::value));

does indeed work.

It does seem as if putting the 'const' at the end is the correct
signature whereas putting it where you originally had it suggests a
const member function pointer and not a member function pointer to a
const member function.

> Have I done something silly? Testing const-member functions seems OK

All the more reason to use the mpl sequence form rather than the
composite form unless there is really a need for the composite form with
some sort of arcane calling convention or compiler-specific syntax.
That's just my opinion of course and I am glad to supply both forms.

Boost list run by bdawes at, gregod at, cpdaniel at, john at