]>
Commit | Line | Data |
---|---|---|
1 | #ifndef BOOST_METAPARSE_V1_ERROR_INDEX_OUT_OF_RANGE_HPP | |
2 | #define BOOST_METAPARSE_V1_ERROR_INDEX_OUT_OF_RANGE_HPP | |
3 | ||
4 | // Copyright Abel Sinkovics (abel@sinkovics.hu) 2013. | |
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 <iostream> | |
10 | #include <string> | |
11 | #include <sstream> | |
12 | ||
13 | namespace boost | |
14 | { | |
15 | namespace metaparse | |
16 | { | |
17 | namespace v1 | |
18 | { | |
19 | namespace error | |
20 | { | |
21 | template <int From, int To, int N> | |
22 | struct index_out_of_range | |
23 | { | |
24 | typedef index_out_of_range type; | |
25 | ||
26 | static std::string get_value() | |
27 | { | |
28 | std::ostringstream s; | |
29 | s | |
30 | << "index (" << N << ") out of range [" | |
31 | << From << "-" << To << "]"; | |
32 | return s.str(); | |
33 | } | |
34 | }; | |
35 | } | |
36 | } | |
37 | } | |
38 | } | |
39 | ||
40 | #endif | |
41 |