memgraph/storage/model/json/real.hpp

34 lines
476 B
C++
Raw Normal View History

2015-07-04 17:39:16 +08:00
#ifndef MEMGRAPH_DATA_MODEL_JSON_REAL_HPP
#define MEMGRAPH_DATA_MODEL_JSON_REAL_HPP
#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