Fix a few inconsistencies
Diffstat:
3 files changed, 22 insertions(+), 17 deletions(-)
@@ -4,7 +4,7 @@
include(cmake/prelude.cmake)
project(
cemplate
VERSION 0.1.8
VERSION 0.1.9
DESCRIPTION "Simple C++ template engine"
HOMEPAGE_URL "https://git.dimitrijedobrota.com/cemplate.git"
LANGUAGES CXX
@@ -35,6 +35,21 @@
std::string join(
return res;
}
class String
{
public:
explicit String(std::string value)
: m_value(std::move(value))
{
}
operator std::string() const; // NOLINT
friend std::ostream& operator<<(std::ostream& ost, const String& rhs);
private:
std::string m_value;
};
class InitlistElem;
class Initlist
@@ -72,6 +87,11 @@
public:
{
}
InitlistElem(String value) // NOLINT
: m_value(std::move(value))
{
}
InitlistElem(std::initializer_list<InitlistElem> list) // NOLINT
: m_value(std::in_place_type<Initlist>, list)
{
@@ -356,21 +376,6 @@
private:
std::string m_value;
};
class String
{
public:
explicit String(std::string value)
: m_value(std::move(value))
{
}
operator std::string() const; // NOLINT
friend std::ostream& operator<<(std::ostream& ost, const String& rhs);
private:
std::string m_value;
};
template<typename T, int key>
std::ostream& operator<<(std::ostream& ost, const T& rhs)
{
@@ -116,7 +116,7 @@
std::string Initlist::format(uint64_t lvl) const
Initlist::operator std::string() const
{
return std::format("{{\n{}{}}};\n", format(indent_lvl + 1), indent());
return std::format("{{\n{}{}}}", format(indent_lvl + 1), indent());
}
Function::operator std::string() const