configuration: support multiple configuration files
This commit is contained in:
@@ -106,8 +106,18 @@ struct option_parser
|
||||
m_defined = true;
|
||||
}
|
||||
|
||||
bool defined() const { return m_defined; }
|
||||
void run_default() const { m_default(); }
|
||||
bool defined() const
|
||||
{
|
||||
return m_defined;
|
||||
}
|
||||
|
||||
void run_default()
|
||||
{
|
||||
if (m_defined)
|
||||
throw std::runtime_error("option already defined");
|
||||
m_default();
|
||||
m_defined = true;
|
||||
}
|
||||
|
||||
private:
|
||||
bool m_defined;
|
||||
|
||||
@@ -32,8 +32,8 @@ template <size_t N> size_t const_strlen(const char (&)[N]) {
|
||||
}
|
||||
|
||||
// it's present in boost for std::string, but we want more general version.
|
||||
template <typename CollectionT, typename StringT>
|
||||
StringT join(CollectionT &&collection, StringT &&separator)
|
||||
template <typename StringT, typename CollectionT>
|
||||
StringT join(const CollectionT &collection, const StringT &separator)
|
||||
{
|
||||
StringT result;
|
||||
auto first = std::begin(collection), last = std::end(collection);
|
||||
|
||||
Reference in New Issue
Block a user