v0.2.5
This commit is contained in:
parent
4f48107812
commit
3f4154c579
1 changed files with 4 additions and 4 deletions
|
@ -5,7 +5,7 @@
|
||||||
// | |\ | (_| | | | | | | __/ (_) | | | |____|_| |_|
|
// | |\ | (_| | | | | | | __/ (_) | | | |____|_| |_|
|
||||||
// |_| \_|\__,_|_| |_| |_|\___|\___/|_| \_____|
|
// |_| \_|\__,_|_| |_| |_|\___|\___/|_| \_____|
|
||||||
// https://github.com/Neargye/nameof
|
// https://github.com/Neargye/nameof
|
||||||
// vesion 0.2.4
|
// vesion 0.2.5
|
||||||
//
|
//
|
||||||
// Licensed under the MIT License <http://opensource.org/licenses/MIT>.
|
// Licensed under the MIT License <http://opensource.org/licenses/MIT>.
|
||||||
// Copyright (c) 2016, 2018 Daniil Goncharov <neargye@gmail.com>.
|
// Copyright (c) 2016, 2018 Daniil Goncharov <neargye@gmail.com>.
|
||||||
|
@ -44,9 +44,9 @@ inline constexpr bool IsLexeme(const char s) noexcept {
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
inline constexpr const char* Nameof(const char* name, const ::std::size_t length) noexcept {
|
inline constexpr const char* Nameof(const char* name, const ::std::size_t length) noexcept {
|
||||||
return length == 0 ? name : detail::IsLexeme(name[length - 1])
|
return ((length == 0) ? name : (detail::IsLexeme(name[length - 1])
|
||||||
? &name[length]
|
? &name[length]
|
||||||
: Nameof(name, length - 1);
|
: Nameof(name, length - 1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace nameof
|
} // namespace nameof
|
||||||
|
|
Loading…
Reference in a new issue