function_types_remove_const_comparison.cpp 534 B

123456789101112131415161718192021
  1. /*<-
  2. Copyright Barrett Adair 2016-2017
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE.md or copy at http ://boost.org/LICENSE_1_0.txt)
  5. ->*/
  6. //[ function_types_remove_const_comparison
  7. #include <type_traits>
  8. #include <boost/callable_traits/remove_member_const.hpp>
  9. struct foo {
  10. void bar() const {}
  11. };
  12. using const_removed = boost::callable_traits::remove_member_const_t<decltype(&foo::bar)>;
  13. static_assert(std::is_same<const_removed, void(foo::*)()>::value, "");
  14. int main(){}
  15. //]