Boost logo

Boost Users :

From: Richard Crossley (rdc_at_[hidden])
Date: 2004-06-07 19:17:14


I'm seeing, what appears to me anyhow, rather strange behaviour with
is_const and remove_const etc when used with arrays.

With VC71 and a recent cvs I see...

is_same<remove_const<const int[1]>::type,int[1]>::value; // true
is_const<const int[1]>::value; // false
??

is_same<remove_const<const int[1][1]>::type,int[1][1]>::value; // false
??
is_same<add_const<int[1][1]>::type,const int[1][1]>::value; // true
is_const<const int[1][1]>::value; // false
??

is_volatile<volatile int[1]>::value; //
false ??
is_same<remove_volatile<volatile int[1][1]>::type,int[1][1]>::value; //
false ??
is_same<add_volatile<int[1][1]>::type,volatile int[1][1]>::value; //
true

Using Comeau 4.3.3;

is_same<remove_const<const int[1]>::type,int[1]>::value; // true
is_const<const int[1]>::value; // true
    
is_same<remove_const<const int[1][1]>::type,int[1][1]>::value; // false
??
is_same<add_const<int[1][1]>::type,const int[1][1]>::value; // true
is_const<const int[1][1]>::value; // true

is_volatile<volatile int[1]>::value; //
true
is_same<remove_volatile<volatile int[1][1]>::type,int[1][1]>::value; //
false ??
is_same<add_volatile<int[1][1]>::type,volatile int[1][1]>::value; //
true

Regards,

Richard.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net