mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-01-08 08:30:17 +00:00
add static_assert and useful member funcs
This commit is contained in:
parent
f83a8b450e
commit
59588e3a10
@ -16,6 +16,7 @@ namespace detail
|
||||
template<typename Container>
|
||||
struct location
|
||||
{
|
||||
static_assert(std::is_same<char, typename Container::value_type>::value,"");
|
||||
using const_iterator = typename Container::const_iterator;
|
||||
|
||||
location(Container cont)
|
||||
@ -39,6 +40,7 @@ struct location
|
||||
template<typename Container>
|
||||
struct region
|
||||
{
|
||||
static_assert(std::is_same<char, typename Container::value_type>::value,"");
|
||||
using const_iterator = typename Container::const_iterator;
|
||||
|
||||
region(const location<Container>& loc)
|
||||
@ -65,6 +67,9 @@ struct region
|
||||
region& operator=(region&&) = default;
|
||||
~region() = default;
|
||||
|
||||
std::string str() const {return std::string(first, last);}
|
||||
std::size_t size() const {return std::distance(first, last);}
|
||||
|
||||
const_iterator begin, first, last, end;
|
||||
std::shared_ptr<const Container> source;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user