static_const.hpp 762 B

123456789101112131415161718192021222324252627
  1. ///////////////////////////////////////////////////////////////////////////////
  2. /// \file static_const.hpp
  3. /// Contains definition of static_const for declaring static constants that
  4. //
  5. // Copyright 2008 Eric Niebler. Distributed under the Boost
  6. // Software License, Version 1.0. (See accompanying file
  7. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  8. #ifndef BOOST_PROTO_DETAIL_STATIC_CONST_HPP_EAN_20_07_2012
  9. #define BOOST_PROTO_DETAIL_STATIC_CONST_HPP_EAN_20_07_2012
  10. namespace boost { namespace proto
  11. {
  12. namespace detail
  13. {
  14. template<typename T>
  15. struct static_const
  16. {
  17. static T const value;
  18. };
  19. template<typename T>
  20. T const static_const<T>::value = {};
  21. }
  22. }}
  23. #endif