#6728 closed Feature Requests (fixed)
function_property_map
Reported by: | Owned by: | Jeremiah Willcock | |
---|---|---|---|
Milestone: | Boost 1.50.0 | Component: | property_map |
Version: | Boost 1.49.0 | Severity: | Cosmetic |
Keywords: | property_map | Cc: |
Description
A missing component in the property_maps library is an adapter for functions to property_maps.
A working implementation under the Boost License can be found here: https://github.com/bo0ts/property_map_extensions/blob/master/function_property_map.hpp
Features: type deduction when available, C++03 compatible, Problems: hacky way of specifying if either std::result_of or boost:result_of is to be used (boost::result_of does not work with lambdas)
It would still require some testing. The required documentation should be minimal.
Attachments (2)
Change History (10)
comment:1 by , 11 years ago
Component: | None → property_map |
---|---|
Owner: | set to |
comment:2 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 11 years ago
by , 11 years ago
Attachment: | function_property_map.hpp added |
---|
by , 11 years ago
Attachment: | function_property_map_test.cpp added |
---|
comment:4 by , 11 years ago
Thanks for fixing those problems.
boost::result_of is unlikely to use the native decltype facilities for some time. This is due to an non-conforming decltype implementation in some compilers and the breakage that enabling this feature caused in Boost. Your version will not be usable with lambdas until this is fixed, but if you deem this acceptable over my hacks to get it working that is alright.
comment:5 by , 11 years ago
I am annoyed by the boost::result_of
bug too; I use BOOST_RESULT_OF_USE_DECLTYPE
to work around the bug when I use C++11 (there are enough parts of Boost that use result_of
that I can't avoid it).
comment:6 by , 11 years ago
But this gets unmanageable and reincluding is not possible thanks to the include guards. I guess there is nothing we can do here without making it a hack. I suggest to leave it the way it is and have users manage BOOST_RESULT_OF_USE_DECLTYPE themselves. The issue can be closed as far as I'm concerned.
comment:7 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:8 by , 11 years ago
I'll make some proposal about decltype-based boost::result_of
on devel ML.
Please check the code and test I'm about to attach. I changed to
boost::result_of
; any bugs in it regarding lambdas are its maintainer's problem and should be fixed there. I also removed the perfect forwarding code because it was broken (seeadd1
and the uses of it in the test code).