Fix clang warning
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
d200cb6510
commit
19440bc103
2 changed files with 12 additions and 12 deletions
|
@ -25,7 +25,7 @@ bool options::contains(char const * n) const {
|
|||
return ::lean::contains(m_value, [&](sexpr const & p) { return to_name(head(p)) == n; });
|
||||
}
|
||||
|
||||
sexpr const & options::get_sexpr(name const & n, sexpr const & default_value) const {
|
||||
sexpr options::get_sexpr(name const & n, sexpr const & default_value) const {
|
||||
sexpr const * r = find(m_value, [&](sexpr const & p) { return to_name(head(p)) == n; });
|
||||
return r == nullptr ? default_value : tail(*r);
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ char const * options::get_string(name const & n, char const * default_value) con
|
|||
return !is_nil(r) && is_string(r) ? to_string(r).c_str() : default_value;
|
||||
}
|
||||
|
||||
sexpr const & options::get_sexpr(char const * n, sexpr const & default_value) const {
|
||||
sexpr options::get_sexpr(char const * n, sexpr const & default_value) const {
|
||||
sexpr const * r = find(m_value, [&](sexpr const & p) { return to_name(head(p)) == n; });
|
||||
return r == nullptr ? default_value : *r;
|
||||
}
|
||||
|
|
|
@ -29,17 +29,17 @@ public:
|
|||
bool contains(name const & n) const;
|
||||
bool contains(char const * n) const;
|
||||
|
||||
bool get_bool(name const & n, bool default_value=false) const;
|
||||
int get_int(name const & n, int default_value=0) const;
|
||||
double get_double(name const & n, double default_value=0.0) const;
|
||||
char const * get_string(name const & n, char const * default_value=nullptr) const;
|
||||
sexpr const & get_sexpr(name const & n, sexpr const & default_value=sexpr()) const;
|
||||
bool get_bool(name const & n, bool default_value=false) const;
|
||||
int get_int(name const & n, int default_value=0) const;
|
||||
double get_double(name const & n, double default_value=0.0) const;
|
||||
char const * get_string(name const & n, char const * default_value=nullptr) const;
|
||||
sexpr get_sexpr(name const & n, sexpr const & default_value=sexpr()) const;
|
||||
|
||||
bool get_bool(char const * n, bool default_value=false) const;
|
||||
int get_int(char const * n, int default_value=0) const;
|
||||
double get_double(char const * n, double default_value=0.0) const;
|
||||
char const * get_string(char const * n, char const * default_value=nullptr) const;
|
||||
sexpr const & get_sexpr(char const * n, sexpr const & default_value=sexpr()) const;
|
||||
bool get_bool(char const * n, bool default_value=false) const;
|
||||
int get_int(char const * n, int default_value=0) const;
|
||||
double get_double(char const * n, double default_value=0.0) const;
|
||||
char const * get_string(char const * n, char const * default_value=nullptr) const;
|
||||
sexpr get_sexpr(char const * n, sexpr const & default_value=sexpr()) const;
|
||||
|
||||
options update(name const & n, sexpr const & v) const;
|
||||
template<typename T> options update(name const & n, T v) const { return update(n, sexpr(v)); }
|
||||
|
|
Loading…
Reference in a new issue