Skip to content
Snippets Groups Projects
Commit 40a2bc5b authored by Martin Marinov's avatar Martin Marinov
Browse files

Add support to Base::FormatT<> for formatting multiple arguments and access to the buffer.

parent 442e1843
Branches
No related tags found
No related merge requests found
......@@ -207,11 +207,25 @@ public:
print(bffr_, _bffr_size, _frmt, _vrbl);
}
#if __cplusplus >= 201103L || _MSC_VER >= 1900 //C++11 support
// Variadic template constructor
template <typename... ArgT>
FormatT(const char* const _frmt, const ArgT&... _args)
{
print(bffr_, _bffr_size, _frmt, _args...);
}
#endif//C++11 support
friend IOutputStream& operator<<(IOutputStream& _os, const Self& _frmt)
{
return _os << _frmt.bffr_;
}
const char* buffer() const { return bffr_; }
private:
char bffr_[_bffr_size];
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment