[libsigcplusplus] Put member_method*<> in sigc::internal namespace.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsigcplusplus] Put member_method*<> in sigc::internal namespace.
- Date: Tue, 8 Mar 2016 12:59:23 +0000 (UTC)
commit 8da18293d8f13c9d65a45c86915ef9f5b828ad34
Author: Murray Cumming <murrayc murrayc com>
Date: Tue Mar 8 13:59:11 2016 +0100
Put member_method*<> in sigc::internal namespace.
sigc++/functors/mem_fun.h | 10 +++++-----
sigc++/member_method_trait.h | 6 +++++-
tests/test_member_method_trait.cc | 22 +++++++++++-----------
3 files changed, 21 insertions(+), 17 deletions(-)
---
diff --git a/sigc++/functors/mem_fun.h b/sigc++/functors/mem_fun.h
index 25358dc..2701959 100644
--- a/sigc++/functors/mem_fun.h
+++ b/sigc++/functors/mem_fun.h
@@ -69,13 +69,13 @@ template <class T_func, class... T_arg>
class mem_functor : public functor_base
{
public:
- using object_type = typename member_method_class<T_func>::type;
+ using object_type = typename internal::member_method_class<T_func>::type;
using function_type = T_func;
- using result_type = typename member_method_result<T_func>::type;
+ using result_type = typename internal::member_method_result<T_func>::type;
using obj_type_with_modifier = typename std::conditional_t<
- member_method_is_const<T_func>::value, const object_type, object_type>;
+ internal::member_method_is_const<T_func>::value, const object_type, object_type>;
/// Constructs an invalid functor.
mem_functor() : func_ptr_(nullptr) {}
@@ -121,9 +121,9 @@ public:
using object_type = typename base_type::object_type;
using obj_type_with_modifier = typename std::conditional_t<
- member_method_is_const<T_func>::value, const object_type, object_type>;
+ internal::member_method_is_const<T_func>::value, const object_type, object_type>;
using T_limit_reference = typename std::conditional_t<
- member_method_is_const<T_func>::value,
+ internal::member_method_is_const<T_func>::value,
limit_reference<const object_type>, limit_reference<object_type>>;
/** Constructs a bound_mem_functor object that wraps the passed method.
diff --git a/sigc++/member_method_trait.h b/sigc++/member_method_trait.h
index 35ad2d1..3c07f1c 100644
--- a/sigc++/member_method_trait.h
+++ b/sigc++/member_method_trait.h
@@ -24,6 +24,8 @@
namespace sigc {
+namespace internal {
+
template <class>
struct member_method_is_const;
@@ -143,6 +145,8 @@ struct member_method_result<T_result(T_obj::*)(T_arg...) const volatile>
using type = T_result;
};
-} /* namespace sigc */
+} // namespace internal
+
+} // namespace sigc
#endif /* _SIGC_MEMBER_METHOD_TRAITS_H_ */
diff --git a/tests/test_member_method_trait.cc b/tests/test_member_method_trait.cc
index 79a87d1..aa481b3 100644
--- a/tests/test_member_method_trait.cc
+++ b/tests/test_member_method_trait.cc
@@ -25,38 +25,38 @@ public:
void test_member_method_is_const()
{
- static_assert(!sigc::member_method_is_const<decltype(&Something::some_func)>::value,
+ static_assert(!sigc::internal::member_method_is_const<decltype(&Something::some_func)>::value,
"member_method_is_const failed to identify a non-const member method.");
- static_assert(!sigc::member_method_is_const<decltype(&Something::some_volatile_func)>::value,
+ static_assert(!sigc::internal::member_method_is_const<decltype(&Something::some_volatile_func)>::value,
"member_method_is_const failed to identify a non-const member method.");
- static_assert(sigc::member_method_is_const<decltype(&Something::some_const_func)>::value,
+ static_assert(sigc::internal::member_method_is_const<decltype(&Something::some_const_func)>::value,
"member_method_is_const failed to identify a const member method.");
- static_assert(sigc::member_method_is_const<decltype(&Something::some_const_volatile_func)>::value,
+
static_assert(sigc::internal::member_method_is_const<decltype(&Something::some_const_volatile_func)>::value,
"member_method_is_const failed to identify a const member method.");
}
void test_member_method_is_volatile()
{
- static_assert(!sigc::member_method_is_volatile<decltype(&Something::some_func)>::value,
+ static_assert(!sigc::internal::member_method_is_volatile<decltype(&Something::some_func)>::value,
"member_method_is_const failed to identify a non-volatile member method.");
- static_assert(!sigc::member_method_is_volatile<decltype(&Something::some_const_func)>::value,
+ static_assert(!sigc::internal::member_method_is_volatile<decltype(&Something::some_const_func)>::value,
"member_method_is_const failed to identify a non-volatile member method.");
- static_assert(sigc::member_method_is_volatile<decltype(&Something::some_volatile_func)>::value,
+ static_assert(sigc::internal::member_method_is_volatile<decltype(&Something::some_volatile_func)>::value,
"member_method_is_const failed to identify a volatile member method.");
- static_assert(sigc::member_method_is_volatile<decltype(&Something::some_const_volatile_func)>::value,
+
static_assert(sigc::internal::member_method_is_volatile<decltype(&Something::some_const_volatile_func)>::value,
"member_method_is_const failed to identify a volatile member method.");
}
void test_member_method_class_type()
{
static_assert(std::is_same<
- sigc::member_method_class<decltype(&Something::some_func)>::type,
+ sigc::internal::member_method_class<decltype(&Something::some_func)>::type,
Something>::value,
"member_method_class_type failed to identify the class type.");
}
@@ -64,12 +64,12 @@ void test_member_method_class_type()
void test_member_method_result_type()
{
static_assert(std::is_same<
- sigc::member_method_result<decltype(&Something::some_int_func)>::type,
+ sigc::internal::member_method_result<decltype(&Something::some_int_func)>::type,
int>::value,
"member_method_result_type failed to identify the result type.");
static_assert(std::is_same<
- sigc::member_method_result<decltype(&Something::some_bool_func)>::type,
+ sigc::internal::member_method_result<decltype(&Something::some_bool_func)>::type,
bool>::value,
"member_method_result_type failed to identify the result type.");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]