[Boost-bugs] [Boost C++ Libraries] #5710: ptree::sort() compilation error

Subject: [Boost-bugs] [Boost C++ Libraries] #5710: ptree::sort() compilation error
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-07-18 13:13:26


#5710: ptree::sort() compilation error
-------------------------------------------+--------------------------------
 Reporter: bolero.murakami+cpp@… | Owner: cornedbee
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: property_tree
  Version: Boost 1.47.0 | Severity: Problem
 Keywords: |
-------------------------------------------+--------------------------------
 It is an error code:

 {{{
 boost::property_tree::ptree pt;
 pt.sort();
 }}}


 Output (VC9):
 {{{
 c:\program files\microsoft visual studio 9.0\vc\include\utility(103) :
 error C2784: 'bool std::operator <(const
 std::basic_string<_Elem,_Traits,_Alloc> &,const _Elem *)' : could not
 deduce template argument for 'const
 std::basic_string<_Elem,_Traits,_Alloc> &' from 'const
 boost::property_tree::basic_ptree<Key,Data>'
         with
         [
             Key=std::string,
             Data=std::string
         ]
         c:\program files\microsoft visual studio
 9.0\vc\include\string(150) : see declaration of 'std::operator <'
         c:\program files\microsoft visual studio
 9.0\vc\include\functional(143) : see reference to class template
 instantiation 'bool std::operator <<const
 Key,boost::property_tree::basic_ptree<Key,Data>>(const
 std::pair<_Ty1,_Ty2> &,const std::pair<_Ty1,_Ty2> &)' being compiled
         with
         [
             Key=std::string,
             Data=std::string,
             _Ty1=const std::string,
 _Ty2=boost::property_tree::basic_ptree<std::string,std::string>
         ]
         c:\program files\microsoft visual studio
 9.0\vc\include\functional(142): while compiling class template member
 function 'bool std::less<_Ty>::operator ()(const _Ty &,const _Ty &) const'
 being compiled
         with
         [
             _Ty=std::pair<const
 std::string,boost::property_tree::basic_ptree<std::string,std::string>>
         ]
         ...
 }}}


 No-argument ptree::sort() in the element less<pair<const string, ptree> >
 to be compared by.

 However, this comparison operators are not defined. Therefore be a
 compilation error.

 I think, the no-argument ptree::sort() should implemented by a comparison
 of key strings.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5710>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC