Boost C++ Libraries: Ticket #10224: [property map] compilation error : make_function_property_map https://svn.boost.org/trac10/ticket/10224 <p> <code>make_function_property_map()</code> function can not apply function pointer. </p> <pre class="wiki">#include &lt;boost/property_map/function_property_map.hpp&gt; int get_prop(double) { return 1; } struct get_prop_functor { typedef int result_type; result_type operator()(double) const { return 1; } }; int main() { const auto p1 = boost::make_function_property_map&lt;double&gt;(get_prop); // compilation error const auto p2 = boost::make_function_property_map&lt;double&gt;(get_prop_functor()); // OK } </pre><p> error message (with gcc 4.8) </p> <pre class="wiki">/Users/hogehoge/language/cpp/main.cpp: In function 'int main()': /Users/hogehoge/language/cpp/main.cpp:14:71: error: no matching function for call to 'make_function_property_map(int (&amp;)(double))' const auto p1 = boost::make_function_property_map&lt;double&gt;(get_prop); // compilation error ^ /Users/hogehoge/language/cpp/main.cpp:14:71: note: candidates are: In file included from /Users/hogehoge/language/cpp/main.cpp:1:0: /Users/hogehoge/repository/GitHub/boost-develop/boost/property_map/function_property_map.hpp:54:1: note: template&lt;class Key, class Func&gt; boost::function_property_map&lt;Func, Key&gt; boost::make_function_property_map(const Func&amp;) make_function_property_map(const Func&amp; f) { ^ /Users/hogehoge/repository/GitHub/boost-develop/boost/property_map/function_property_map.hpp:54:1: note: template argument deduction/substitution failed: /Users/hogehoge/repository/GitHub/boost-develop/boost/property_map/function_property_map.hpp: In substitution of 'template&lt;class Key, class Func&gt; boost::function_property_map&lt;Func, Key&gt; boost::make_function_property_map(const Func&amp;) [with Key = double; Func = int(double)]': /Users/hogehoge/language/cpp/main.cpp:14:71: required from here /Users/hogehoge/repository/GitHub/boost-develop/boost/property_map/function_property_map.hpp:54:1: error: function returning a function /Users/hogehoge/repository/GitHub/boost-develop/boost/property_map/function_property_map.hpp:60:1: note: template&lt;class Key, class Ret, class Func&gt; boost::function_property_map&lt;Func, Key, Ret&gt; boost::make_function_property_map(const Func&amp;) make_function_property_map(const Func&amp; f) { ^ /Users/hogehoge/repository/GitHub/boost-develop/boost/property_map/function_property_map.hpp:60:1: note: template argument deduction/substitution failed: /Users/hogehoge/language/cpp/main.cpp:14:71: note: couldn't deduce template parameter 'Ret' const auto p1 = boost::make_function_property_map&lt;double&gt;(get_prop); // compilation error </pre><p> I think should remove <code>const &amp;</code> from parameter. </p> <p> before: </p> <pre class="wiki">template&lt;typename Key, typename Func&gt; function_property_map&lt;Func, Key&gt; make_function_property_map(const Func&amp; f) { return function_property_map&lt;Func, Key&gt;(f); } template&lt;typename Key, typename Ret, typename Func&gt; function_property_map&lt;Func, Key, Ret&gt; make_function_property_map(const Func&amp; f) { return function_property_map&lt;Func, Key, Ret&gt;(f); } </pre><p> after: </p> <pre class="wiki">template&lt;typename Key, typename Func&gt; function_property_map&lt;Func, Key&gt; make_function_property_map(Func f) { return function_property_map&lt;Func, Key&gt;(f); } template&lt;typename Key, typename Ret, typename Func&gt; function_property_map&lt;Func, Key, Ret&gt; make_function_property_map(Func f) { return function_property_map&lt;Func, Key, Ret&gt;(f); } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10224 Trac 1.4.3