memgraph/data_model/json/real.hpp

34 lines
476 B
C++
Raw Normal View History

2015-06-22 04:20:36 +08:00
#ifndef MEMGRAPH_DATA_MODEL_JSON_REAL_HPP
#define MEMGRAPH_DATA_MODEL_JSON_REAL_HPP
2015-06-22 03:15:46 +08:00
#include "primitive.hpp"
namespace json {
class Real final : public Primitive<float>
{
public:
Real() {}
Real(float value)
: Primitive<float>(value) {}
virtual bool is_real() const;
virtual operator std::string() const;
};
bool Real::is_real() const
{
return true;
}
Real::operator std::string() const
{
return std::to_string(value);
}
}
#endif