[patch] Minor simplification in <functional>
Jonathan Wakely
jwakely@redhat.com
Wed Apr 16 18:31:00 GMT 2014
This avoids a template instantiation when storing a function pointer
in a std::function.
At some point I want to extend the definition of
__is_location_invariant to include trivially-copyable object types.
I suspect this may be why boost::function can perform significantly
better than our std::function in some cases.
Tested x86_64-linux, committed to trunk.
-------------- next part --------------
commit 11ba841cb0b5655c974dfed32330b077a4d3b312
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Wed Apr 16 18:21:28 2014 +0100
* include/std/functional (__is_location_invariant): Use __or_ helper.
diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional
index 0e80fa3..295022d 100644
--- a/libstdc++-v3/include/std/functional
+++ b/libstdc++-v3/include/std/functional
@@ -1747,8 +1747,7 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type)
*/
template<typename _Tp>
struct __is_location_invariant
- : integral_constant<bool, (is_pointer<_Tp>::value
- || is_member_pointer<_Tp>::value)>
+ : __or_<is_pointer<_Tp>, is_member_pointer<_Tp>>::type
{ };
class _Undefined_class;
More information about the Gcc-patches
mailing list