3 Replies Latest reply: Mar 22, 2012 3:55 PM by Steve.Clamage-Oracle RSS

    Problems with Boost 1.49.0 map and flat_map with Solaris Studio 12.3

    925496
      I'm having problems using the Boost 1.49.0 map and flat_map classes. I had problems using those Boost classes on Solaris Studio 12.2 (SPARC running Solaris 10) so I upgraded to Solaris Studio 12.3 to see if that helped. Well, the compile errors are different but it still doesn't work.

      Here's the compile command line and errors:

      # CC -o tst -library=stlport4 -xtarget=ultra -m64 -I . tst.cpp
      "./boost/container/detail/flat_tree.hpp", line 169: Error: operator is not a member of boost::container::container_detail::flat_tree<std::string, boost::container::container_detail::pair<std::string, boost::container::flat_map<std::string, boost::container::flat_map<int, int, std::less<int>, std::allocator<std::pair<int, int>>>, std::less<std::string>, std::allocator<std::pair<std::string, boost::container::flat_map<int, int, std::less<int>, std::allocator<std::pair<int, int>>>>>>>, boost::container::container_detail::select1st<boost::container::container_detail::pair<std::string, boost::container::flat_map<std::string, boost::container::flat_map<int, int, std::less<int>, std::allocator<std::pair<int, int>>>, std::less<std::string>, std::allocator<std::pair<std::string, boost::container::flat_map<int, int, std::less<int>, std::allocator<std::pair<int, int>>>>>>>>, std::less<std::string>, std::allocator<std::allocator<void>::_Tp1>>::Data.
      "./boost/container/flat_map.hpp", line 175: Where: While instantiating "boost::container::container_detail::flat_tree<std::string, boost::container::container_detail::pair<std::string, boost::container::flat_map<std::string, boost::container::flat_map<int, int, std::less<int>, std::allocator<std::pair<int, int>>>, std::less<std::string>, std::allocator<std::pair<std::string, boost::container::flat_map<int, int, std::less<int>, std::allocator<std::pair<int, int>>>>>>>, boost::container::container_detail::select1st<boost::container::container_detail::pair<std::string, boost::container::flat_map<std::string, boost::container::flat_map<int, int, std::less<int>, std::allocator<std::pair<int, int>>>, std::less<std::string>, std::allocator<std::pair<std::string, boost::container::flat_map<int, int, std::less<int>, std::allocator<std::pair<int, int>>>>>>>>, std::less<std::string>, std::allocator<std::allocator<void>::_Tp1>>::flat_tree()".
      "./boost/container/flat_map.hpp", line 175: Where: Instantiated from boost::container::flat_map<std::string, boost::container::flat_map<std::string, boost::container::flat_map<int, int, std::less<int>, std::allocator<std::pair<int, int>>>, std::less<std::string>, std::allocator<std::pair<std::string, boost::container::flat_map<int, int, std::less<int>, std::allocator<std::pair<int, int>>>>>>, std::less<std::string>, std::allocator<std::pair<std::string, boost::container::flat_map<std::string, boost::container::flat_map<int, int, std::less<int>, std::allocator<std::pair<int, int>>>, std::less<std::string>, std::allocator<std::pair<std::string, boost::container::flat_map<int, int, std::less<int>, std::allocator<std::pair<int, int>>>>>>>>>::flat_map().
      "tst.cpp", line 49: Where: Instantiated from non-template code.
      1 Error(s) detected.


      I tried using the d option to tell the compiler to not inline functions.  With d I'm getting a slightly different error:

      # CC -o tst -library=stlport4 -xtarget=ultra -m64 +d -I . tst.cpp
      "./boost/container/flat_map.hpp", line 229: Error: Cannot assign const boost::container::container_detail::flat_tree<int, boost::container::container_detail::pair<int, int>, boost::container::container_detail::select1st<boost::container::container_detail::pair<int, int>>, std::less<int>, std::allocator<std::allocator<void>::_Tp1>> to boost::container::container_detail::flat_tree<int, boost::container::container_detail::pair<int, int>, boost::container::container_detail::select1st<boost::container::container_detail::pair<int, int>>, std::less<int>, std::allocator<std::allocator<void>::_Tp1>> without "boost::container::container_detail::flat_tree<int, boost::container::container_detail::pair<int, int>, boost::container::container_detail::select1st<boost::container::container_detail::pair<int, int>>, std::less<int>, std::allocator<std::allocator<void>::_Tp1>>::operator=(const boost::container::container_detail::flat_tree<int, boost::container::container_detail::pair<int, int>, boost::container::container_detail::select1st<boost::container::container_detail::pair<int, int>>, std::less<int>, std::allocator<std::allocator<void>::_Tp1>>&)";.
      "./boost/container/flat_map.hpp", line 105: Where: While instantiating "boost::container::flat_map<int, int, std::less<int>, std::allocator<std::pair<int, int>>>::operator=(const boost::rv<boost::container::flat_map<int, int, std::less<int>, std::allocator<std::pair<int, int>>>>&)".
      "./boost/container/flat_map.hpp", line 105: Where: Instantiated from non-template code.
      1 Error(s) detected.


      It appears that the compiler is not recognizing the operator= in flat_tree but I've checked and there are two operator= in the class flat_tree.

      This same code works fine under the g++ compiler. Any help or ideas you have would be appreciated.