Removed the overloads of add() by using a templated type

This commit is contained in:
Benoît Blanchon
2014-06-27 13:45:50 +02:00
parent b7933f85ba
commit 1d064d709b
2 changed files with 4 additions and 17 deletions

View File

@ -17,22 +17,8 @@ public:
itemCount = 0;
}
void add(const char* value)
{
add(JsonValue(value));
}
void add(double value)
{
add(JsonValue(value));
}
void add(bool value)
{
add(JsonValue(value));
}
void add(JsonObjectBase& value)
template<typename T>
void add(T value)
{
add(JsonValue(value));
}

View File

@ -17,7 +17,8 @@ public:
itemCount = 0;
}
void add(const char* key, const char* value)
template<typename T>
void add(const char* key, T value)
{
add(key, JsonValue(value));
}