Fix variant type for systems where time_t is int

This commit is contained in:
Jon Daniel 2012-05-03 01:55:17 +00:00
parent f77e8330ed
commit d6818a122b
2 changed files with 4 additions and 4 deletions

View File

@ -73,7 +73,7 @@ config::attribute_value &config::attribute_value::operator=(size_t v)
return *this;
}
config::attribute_value &config::attribute_value::operator=(time_t v)
config::attribute_value &config::attribute_value::operator=(long v)
{
value = v;
return *this;
@ -147,7 +147,7 @@ struct config_attribute_str_visitor : boost::static_visitor<std::string>
{ return str_cast(s); }
std::string operator()(int i) const
{ return str_cast(i); }
std::string operator()(time_t t) const
std::string operator()(long t) const
{ return str_cast(t); }
std::string operator()(std::string const &s) const
{ return s; }

View File

@ -172,7 +172,7 @@ public:
*/
class attribute_value
{
typedef boost::variant<boost::blank, bool, int, time_t, size_t,double, std::string, t_string> value_type;
typedef boost::variant<boost::blank, bool, int, long, size_t,double, std::string, t_string> value_type;
value_type value;
public:
@ -189,7 +189,7 @@ public:
attribute_value &operator=(int v);
attribute_value &operator=(double v);
attribute_value &operator=(size_t v);
attribute_value &operator=(time_t v);
attribute_value &operator=(long v);
attribute_value &operator=(const char *v)
{ return operator=(std::string(v)); }