]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/metaparse/include/boost/metaparse/v1/error/unpaired.hpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / metaparse / include / boost / metaparse / v1 / error / unpaired.hpp
1 #ifndef BOOST_METAPARSE_V1_ERROR_UNPAIRED_HPP
2 #define BOOST_METAPARSE_V1_ERROR_UNPAIRED_HPP
3
4 // Copyright Abel Sinkovics (abel@sinkovics.hu) 2015.
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8
9 #include <boost/mpl/vector.hpp>
10
11 #include <iostream>
12 #include <string>
13 #include <sstream>
14
15 namespace boost
16 {
17 namespace metaparse
18 {
19 namespace v1
20 {
21 namespace error
22 {
23 template <int Line, int Col, class Msg = boost::mpl::na>
24 struct unpaired
25 {
26 typedef unpaired type;
27
28 static std::string get_value()
29 {
30 std::ostringstream s;
31 s << Msg::get_value() << " (see " << Line << ":" << Col << ")";
32 return s.str();
33 }
34 };
35
36 template <int Line, int Col>
37 struct unpaired<Line, Col, boost::mpl::na>
38 {
39 typedef unpaired type;
40
41 template <class Msg = boost::mpl::na>
42 struct apply : unpaired<Line, Col, Msg> {};
43 };
44 }
45 }
46 }
47 }
48
49 #endif
50