diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2019-01-18 18:28:12 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2019-01-18 18:28:12 +0000 |
commit | e408b9fe771bb480b620c30f5e2de4f6c3b15669 (patch) | |
tree | b1341d455b0a3b38a10f290eea902c1ffbbd6970 | |
parent | Literal operator based inline formatting (diff) | |
download | libadhocutil-e408b9fe771bb480b620c30f5e2de4f6c3b15669.tar.bz2 libadhocutil-e408b9fe771bb480b620c30f5e2de4f6c3b15669.tar.xz libadhocutil-e408b9fe771bb480b620c30f5e2de4f6c3b15669.zip |
Add missing doxygen commentslibadhocutil-0.6.0
-rw-r--r-- | libadhocutil/compileTimeFormatter.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libadhocutil/compileTimeFormatter.h b/libadhocutil/compileTimeFormatter.h index 6a932be..562c511 100644 --- a/libadhocutil/compileTimeFormatter.h +++ b/libadhocutil/compileTimeFormatter.h @@ -137,6 +137,11 @@ namespace AdHoc { std::basic_stringstream<char_type> s; return write(s, pn...).str(); } + /** + * Get a string containing the result of formatting. + * @param pn the format arguments. + * @return the formatted string. + */ template<typename ... Pn> inline auto operator()(const Pn & ... pn) const { @@ -154,6 +159,12 @@ namespace AdHoc { { return Parser<stream, 0, Pn...>::run(s, pn...); } + /** + * Write the result of formatting to the given stream. + * @param s the stream to write to. + * @param pn the format arguments. + * @return the stream. + */ template<typename stream, typename ... Pn> inline stream & operator()(stream & s, const Pn & ... pn) const { @@ -195,8 +206,10 @@ namespace AdHoc { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wgnu-string-literal-operator-template" #endif + /// CTF format string holder template<typename T, T ... t> struct FMT { + /// CTF format string static constexpr char __FMT[] = {t...}; }; template<typename T, T ... t> inline auto operator""_fmt() noexcept |