MCPcopy Create free account
hub / github.com/davisking/dlib / assign

Method assign

dlib/optional.h:188–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186
187 template<class Optional>
188 constexpr void assign(Optional&& rhs) noexcept(std::is_nothrow_constructible<T,Optional>::value &&
189 std::is_nothrow_assignable<T&,Optional>::value)
190 {
191 if (this->active && rhs.active)
192 this->val = std::forward<Optional>(rhs).val;
193 else if (!this->active && rhs.active)
194 construct(std::forward<Optional>(rhs).val);
195 else if (this->active && !rhs.active)
196 destruct();
197 }
198
199 constexpr void destruct() noexcept(std::is_nothrow_destructible<T>::value)
200 {

Callers 7

np_to_cppFunction · 0.45
process_fileFunction · 0.45
optionalClass · 0.45

Calls 1

constructFunction · 0.85

Tested by

no test coverage detected