MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / takeValue

Method takeValue

source/core/StarVariant.hpp:862–872  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

860
861template <typename... Types>
862Variant<Types...> MVariant<Types...>::takeValue() {
863 if (empty())
864 throw BadVariantCast();
865
866 Variant<Types...> r;
867 call([&r](auto& v) {
868 r = std::move(v);
869 });
870 m_variant = MVariantEmpty();
871 return r;
872}
873
874template <typename... Types>
875bool MVariant<Types...>::empty() const {

Callers 2

updateMethod · 0.80
TESTFunction · 0.80

Calls 1

MVariantEmptyClass · 0.85

Tested by 1

TESTFunction · 0.64