G
guojianlee
I have some problem ,when compiling program in
hp 11.1
aCC: HP ANSI C++ B3910B A.03.37
,just like this "aCC test.cpp".
but when i compile it with option -AA ,every thing is OK.
source code and error info as follow.who can tell me why ,thank you
very much.
source code:
$vi test.cpp
#include <map>
#include <string>
namespace std {} using namespace std;
int main()
{
map<string,string > m;
string a("11"),b("2222");
m.insert(make_pair(a,b));
}
~
~
error info:
$aCC test.cpp
Error 226: "test.cpp", line 9 # No appropriate function found for call
of 'insert'. Last viable candidate was
"pair<rb_tree<basic_string<char,string_char_traits<char>,allocator>,pair<const
^^^^^^
aCC -AA test.cpp
when I checked /opt/aCC/include/map ,found a macro
"RWSTD_NO_CONST_INST". Maybe it is helpful for you .
class map
{
public:
//
// types
//
typedef Key key_type;
#ifndef RWSTD_NO_CONST_INST
typedef pair<const Key, T> value_type;
#else
typedef pair<Key, T> value_type;
#endif
typedef Compare key_compare;
typedef Allocator allocator_type;
typedef T mapped_type;
hp 11.1
aCC: HP ANSI C++ B3910B A.03.37
,just like this "aCC test.cpp".
but when i compile it with option -AA ,every thing is OK.
source code and error info as follow.who can tell me why ,thank you
very much.
source code:
$vi test.cpp
#include <map>
#include <string>
namespace std {} using namespace std;
int main()
{
map<string,string > m;
string a("11"),b("2222");
m.insert(make_pair(a,b));
}
~
~
error info:
$aCC test.cpp
Error 226: "test.cpp", line 9 # No appropriate function found for call
of 'insert'. Last viable candidate was
"pair<rb_tree<basic_string<char,string_char_traits<char>,allocator>,pair<const
basic_string said:>,select1st<pair<const
basic_string said:>,basic_string<char,string_char_traits<char>,allocator>
,less<basic_string<char,string_char_traits<char>,allocator>
>,allocator>::iterator,bool>
map said:,allocator>::insert(const pair<const
["/opt/aCC/include/map", line 254]. Argument of type 'structbasic_string said:
be converted to 'const pair<constpair said:' could not
m.insert(make_pair(a,b));basic_string said:
^^^^^^
aCC -AA test.cpp
when I checked /opt/aCC/include/map ,found a macro
"RWSTD_NO_CONST_INST". Maybe it is helpful for you .
class map
{
public:
//
// types
//
typedef Key key_type;
#ifndef RWSTD_NO_CONST_INST
typedef pair<const Key, T> value_type;
#else
typedef pair<Key, T> value_type;
#endif
typedef Compare key_compare;
typedef Allocator allocator_type;
typedef T mapped_type;