remove_pointer.qbk 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. [/
  2. Copyright 2007 John Maddock.
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE_1_0.txt or copy at
  5. http://www.boost.org/LICENSE_1_0.txt).
  6. ]
  7. [section:remove_pointer remove_pointer]
  8. template <class T>
  9. struct remove_pointer
  10. {
  11. typedef __below type;
  12. };
  13. template <class T> using remove_pointer_t = typename remove_pointer<T>::type; // C++11 and above
  14. __type The same type as `T`, but with any pointer modifier removed. Note that pointers to members are left unchanged:
  15. removing the pointer decoration would result in an invalid type.
  16. __std_ref 8.3.1.
  17. [all_compilers]
  18. __header ` #include <boost/type_traits/remove_pointer.hpp>` or ` #include <boost/type_traits.hpp>`
  19. [table Examples
  20. [ [Expression] [Result Type]]
  21. [[`remove_pointer<int>::type`][`int`]]
  22. [[`remove_pointer<int const*>::type`] [`int const`]]
  23. [[`remove_pointer<int const**>::type`] [`int const*`]]
  24. [[`remove_pointer<int&>::type`] [`int&`]]
  25. [[`remove_pointer<int*&>::type`] [`int*&`]]
  26. ]
  27. [endsect]