mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-31 07:06:45 +00:00
Do not allow to construct NormalizedView from std::string
To avoid implicit conversion via Normalized which creates NormalizedView from a temporary Normalized. Mark constructors explicit on purpose so there is no ambiguity on implicit conversion when there is an overloaded function like: void f(const Normalized&); void f(NormalizedView);
This commit is contained in:
parent
a9281b5246
commit
a49de4b9f1
1 changed files with 4 additions and 0 deletions
|
@ -88,6 +88,10 @@ namespace VFS::Path
|
|||
|
||||
NormalizedView(const Normalized& value) noexcept;
|
||||
|
||||
explicit NormalizedView(const std::string&) = delete;
|
||||
|
||||
explicit NormalizedView(std::string&&) = delete;
|
||||
|
||||
constexpr std::string_view value() const noexcept { return mValue; }
|
||||
|
||||
friend constexpr bool operator==(const NormalizedView& lhs, const NormalizedView& rhs) = default;
|
||||
|
|
Loading…
Reference in a new issue