nkzxw / ontl

Automatically exported from code.google.com/p/ontl
0 stars 0 forks source link

std::map::operator != ussage generates compiler error #29

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I use VC2008 compiler (without SP1 installed).

The sample code is:

    std::map<int, int>  test1;
    test1[1] = 1;
    test1[2] = 2;
    std::map<int, int> test2( test1 );

    if( test1 != test2 ) {
        return 1;
    }

The error message is:

1>d:\agnitum.svn\sandbox\branches\rdb\sandbox\lib\rdb2\regression
\unit_test_ntl.cpp(130) : error C2243: 'type cast' : conversion from 
'std::map<Key,T> *' to 'const tree::rb_tree::rb_tree<T,Compare,Allocator> 
&' exists, but is inaccessible
1>        with
1>        [
1>            Key=int,
1>            T=int
1>        ]
1>        and
1>        [
1>            T=std::pair<const int,int>,
1>            
Compare=std::__::value_compare<int,int,std::less<int>,std::allocator<std::pair<c
onst 
int,int>>>,
1>            Allocator=std::allocator<std::pair<const int,int>>
1>        ]

Original issue reported on code.google.com by andy.ya...@gmail.com on 9 Mar 2009 at 4:56

GoogleCodeExporter commented 9 years ago
Fixed in r516.

Original comment by icestudent@gmail.com on 9 Mar 2009 at 7:12