Boost logo

Boost :

From: Matthias Troyer (troyer_at_[hidden])
Date: 2006-08-09 10:34:10

On Aug 9, 2006, at 10:17 PM, Thorsten Ottosen wrote:

> Stephen Hewitt < <at>> writes:
>> I originally posted this message in Boost-users but I think Boost-
>> developers
>> is probably more suitable. It regards a non-standard extension
>> which I think
>> is being used in Boost.Serialization. I have mailed the author (and
>> Boost-users) but he feels the construct is legal.
> I think you have to change it a little to make it legal:
>> The "make_nvp" function looks like as follows:
>> [CODE]
>> nvp<T> make_nvp(const char * name, T & t){
>> return nvp<T>(name, t);
>> }
>> [/CODE]
> If the return type is "const vnp<T>" it should work.
> I'm wondering why the orginal code compiles on other compilers.

Actually the code in the CVS is:

template<class T>
nvp<T> make_nvp(const char * name, T & t){
     return nvp<T>(name, t);

The const is omitted only on some nonconforming compilers such as


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