]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/multiprecision/test/math/table_type.hpp
32ff66cb98892bbb1b8ebe4df694347d961746b3
[ceph.git] / ceph / src / boost / libs / multiprecision / test / math / table_type.hpp
1 ///////////////////////////////////////////////////////////////
2 // Copyright 2012 John Maddock. Distributed under the Boost
3 // Software License, Version 1.0. (See accompanying file
4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
5
6 #ifndef BOOST_MP_TABLE_TYPE
7 #define BOOST_MP_TABLE_TYPE
8
9 #include <libs/math/test/table_type.hpp>
10 #include <boost/multiprecision/number.hpp>
11
12 struct string_table_entry
13 {
14 private:
15 const char* m_data;
16 public:
17 string_table_entry(const char* p) : m_data(p) {}
18
19 template <class T>
20 operator T () const
21 {
22 return static_cast<T>(m_data);
23 }
24 };
25
26 inline std::ostream& operator << (std::ostream& os, string_table_entry const & what)
27 {
28 return os << static_cast<const char*>(what);
29 }
30
31 template <class Backend, boost::multiprecision::expression_template_option ExpressionTemplates>
32 struct table_type<boost::multiprecision::number<Backend, ExpressionTemplates> >
33 {
34 typedef string_table_entry type;
35 };
36
37 #define SC_(x) string_table_entry(BOOST_STRINGIZE(x))
38
39 #endif
40