Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ target_link_libraries(boost_property_map
Boost::smart_ptr
Boost::throw_exception
Boost::type_traits
Boost::utility
)

if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
Expand Down
3 changes: 1 addition & 2 deletions build.jam
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ constant boost_dependencies :
/boost/smart_ptr//boost_smart_ptr
/boost/throw_exception//boost_throw_exception
/boost/type_index//boost_type_index
/boost/type_traits//boost_type_traits
/boost/utility//boost_utility ;
/boost/type_traits//boost_type_traits ;

project /boost/property_map
: common-requirements
Expand Down
2 changes: 1 addition & 1 deletion doc/function_property_map.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ <H3>Template Parameters</H3>
<TR>
<TD><TT>Ref</TT></TD>
<TD>The result type of the function.</TD>
<TD><TT>boost::result_of&lt;const UnaryFunction(const Key&amp;)&gt;::type</TT></TD>
<TD><TT>decltype(std::declval&lt;const UnaryFunction&gt;()(std::declval&lt;const Key&amp;&gt;()))</TT></TD>
</TR>


Expand Down
2 changes: 1 addition & 1 deletion doc/transform_value_property_map.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ <H3>Template Parameters</H3>
<TR>
<TD><TT>Ref</TT></TD>
<TD>The result type of the function.</TD>
<TD><TT>boost::result_of&lt;const UnaryFunction(property_traits&lt;PM&gt;::reference)&gt;::type</TT></TD>
<TD><TT>decltype(std::declval&lt;const UnaryFunction&gt;()(std::declval&lt;property_traits&lt;PM&gt;::reference&gt;()))</TT></TD>
</TR>


Expand Down
15 changes: 13 additions & 2 deletions include/boost/property_map/function_property_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Author: Philipp Moeller
//
// Copyright 2012, Philipp Moeller
// Copyright 2026, Arnaud Becheler
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
Expand All @@ -16,13 +17,23 @@
#include <boost/config.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/type_traits.hpp>
#include <boost/utility/result_of.hpp>
#include <type_traits>
#include <utility>

namespace boost {

template<typename Func, typename Key, typename Ret = typename boost::result_of<const Func(const Key&)>::type>
namespace detail {

// MSVC in permissive mode cannot evaluate a bare decltype default template argument
template <typename Func, typename Key>
struct function_property_map_result
{
using type = decltype(std::declval<const Func>()(std::declval<const Key&>()));
};

} // namespace detail

template<typename Func, typename Key, typename Ret = typename detail::function_property_map_result<Func, Key>::type>
class function_property_map: public put_get_helper<Ret, function_property_map<Func, Key, Ret> > {
public:
typedef Key key_type;
Expand Down
15 changes: 13 additions & 2 deletions include/boost/property_map/transform_value_property_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Author: Philipp Moeller
//
// Copyright 2012, Philipp Moeller
// Copyright 2026, Arnaud Becheler
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
Expand All @@ -16,13 +17,23 @@
#include <boost/config.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/type_traits.hpp>
#include <boost/utility/result_of.hpp>
#include <type_traits>
#include <utility>

namespace boost {

template<typename Func, typename PM, typename Ret = typename boost::result_of<const Func(typename property_traits<PM>::reference)>::type>
namespace detail {

// MSVC in permissive mode cannot evaluate a bare decltype default template argument
template <typename Func, typename PM>
struct transform_value_property_map_result
{
using type = decltype(std::declval<const Func>()(std::declval<typename property_traits<PM>::reference>()));
};

} // namespace detail

template<typename Func, typename PM, typename Ret = typename detail::transform_value_property_map_result<Func, PM>::type>
class transform_value_property_map: public put_get_helper<Ret, transform_value_property_map<Func, PM, Ret> > {
public:
typedef typename property_traits<PM>::key_type key_type;
Expand Down
Loading