Hi,

A thought occurred to me about optional<>

This is again about having the constructor non-explicit
(I would really like to have this :-)

could you use partial specialization to do this ?

The code below has the desired behaviour.
usage gives the programmer the ability to choose whether the constructor
is explicit or not

Are there any problems with this approach ?

	Vin

template< typename T, bool bIsExplicit = true >
class C
{
public:
   C( const T )
   {
   	g = 9;
   };
};

template< typename T >
class C< T, true >
{
public:
   explicit C( const T )
   {
    	g = 2;
   }
};

void test1(C<int> c)
{
	int grr = 90;
}

void test2(C<int, false> c)
{
	int grr = 99;
}



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to