Summary: Possibly wrong interaction of Variant and const arrays
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from cybevnm <> 2012-07-31 12:36:58 PDT ---
During initializing Variant, D discards top level const of array, which 
leads to little unintuitive behaviour. Consider code:

import std.stdio;
import std.variant;
void main()
  const int[] arr;
  Variant v = Variant( arr );
  writeln( v.peek!( typeof( arr ) )() );
  writeln( v.peek!( const(int)[] )() );
  writeln( v.type() );

...and output:
%dmd main.d && ./main.d

As you can see peek works successfully not for original array type, but 
for type without top level const. Is Variant supposed to work in that way ?

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to