diff options
author | Alex Turbov <i.zaufi@gmail.com> | 2022-08-24 04:41:41 (GMT) |
---|---|---|
committer | Alex Turbov <i.zaufi@gmail.com> | 2022-11-17 12:37:12 (GMT) |
commit | 69918b07e17cce822ad8f11950da476c42e419ee (patch) | |
tree | 2dec5b12c0b4e3702dbdc31b5bee1b72e21ad8e6 /Source/cmDocumentationEntry.h | |
parent | 439d2cf9cb79884747b3d3d56f83b044a108c40a (diff) | |
download | CMake-69918b07e17cce822ad8f11950da476c42e419ee.zip CMake-69918b07e17cce822ad8f11950da476c42e419ee.tar.gz CMake-69918b07e17cce822ad8f11950da476c42e419ee.tar.bz2 |
cmDocumentationEntry: Drop all user provided ctors for C++ >= 14
There is no need for them cuz:
- the last field has a default value
- all static instances use 2 arguments convertible to `std::string`
- "dynamic" instances used for _Generator_ doc entries access
fields diectly using default constructed instance
Moreover, compiler may generate move ctor/assign when needed.
Diffstat (limited to 'Source/cmDocumentationEntry.h')
-rw-r--r-- | Source/cmDocumentationEntry.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/cmDocumentationEntry.h b/Source/cmDocumentationEntry.h index aa97391..c66b21e 100644 --- a/Source/cmDocumentationEntry.h +++ b/Source/cmDocumentationEntry.h @@ -9,17 +9,16 @@ /** Standard documentation entry for cmDocumentation's formatting. */ struct cmDocumentationEntry { - std::string Name; - std::string Brief; - char CustomNamePrefix = ' '; +#if __cplusplus <= 201103L cmDocumentationEntry() = default; - cmDocumentationEntry(const char* const n, const char* const b) + cmDocumentationEntry(const std::string& name, const std::string& brief) + : Name{ name } + , Brief{ brief } { - if (n) { - this->Name = n; - } - if (b) { - this->Brief = b; - } } +#endif + + std::string Name = {}; + std::string Brief = {}; + char CustomNamePrefix = ' '; }; |