[Boost-bugs] [Boost C++ Libraries] #13327: Issue with boost::property_tree::ptree inside lambda with a capture using Visual Studio 2017

Subject: [Boost-bugs] [Boost C++ Libraries] #13327: Issue with boost::property_tree::ptree inside lambda with a capture using Visual Studio 2017
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-12-06 10:11:34


#13327: Issue with boost::property_tree::ptree inside lambda with a capture using
Visual Studio 2017
----------------------------------+----------------------------
 Reporter: shubham.srivastava@… | Owner: Sebastian Redl
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: property_tree
  Version: Boost 1.63.0 | Severity: Problem
 Keywords: |
----------------------------------+----------------------------
 We are running into an issue with Boost 1.56.0, in boost::property_tree::
 ptree, when using it inside lambda function with a capture using Visual
 Studio 2017.

 I get the following errors from line 4 and line 6 when compiling the
 attached file.

 boost\include\boost-
 1_56\boost\property_tree\detail\ptree_implementation.hpp(252): error
 C2440: '<function-style-cast>': cannot convert from
 'boost::multi_index::detail::bidir_node_iterator<boost::multi_index::detail::sequenced_index_node<Super>>'
 to
 'boost::property_tree::basic_ptree<std::string,std::string,std::less<Key>>::const_iterator'
         with
         [
 Super=boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::index_node_base<std::pair<const
 std::string,boost::property_tree::basic_ptree<std::string,std::string,std::less<std::string>>>,std::allocator<std::pair<const
 std::string,boost::property_tree::basic_ptree<std::string,std::string,std::less<std::string>>>>>>
         ]
         and
         [
             Key=std::string
         ]
 boost\include\boost-
 1_56\boost\property_tree\detail\ptree_implementation.hpp(252): note: No
 constructor could take the source type, or constructor overload resolution
 was ambiguous

 note: see reference to function template instantiation
 'boost::property_tree::basic_ptree<std::string,std::string,std::less<Key>>::const_iterator
 boost::property_tree::basic_ptree<Key,std::string,std::less<Key>>::begin(void)
 const' being compiled
         with
         [
             Key=std::string
         ]

 The workaround that we have is to use auto instead of the actual types for
 the const_iterator returned from begin(). See attached cpp file.

-- 
Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13327>
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-12-06 10:18:27 UTC