Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-11-08 08:48:05


Daniel Earwicker <daniel.earwicker_at_[hidden]> writes:

> On 11/3/05, David Abrahams <dave_at_[hidden]> wrote:
>> Something like:
>>
>> static char (& has_key(K const&) )[2];
>>
>> BOOST_MPL_ASSERT_MSG(
>> sizeof(Next::has_key(make<K>())) == 1
>> , duplicate_keyword, (K)
>> );
>>
>> If you could submit a patch to the current CVS along with an
>> expected-compilation-failure test case, I'd be happy to apply it.
>
> Excellent, thanks.
>
> One question about the above code: is make<> already declared somewhere?

Probably a thousand places ;-)

> In the meantime I've added this as a member of arg_list:
>
> template <class T>
> static const T &make();
>
> Or how about passing has_key a pointer, as NULL pointers are easy to
> make?

Yeah, that saves a make(). Good idea.

> Apologies for my ignorance about these details.

You seem pretty knowledgeable to me :)

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk