MCPcopy Create free account
hub / github.com/covscript/covscript / swap

Function swap

include/covscript/core/variable.hpp:695–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

693 }
694
695 inline void swap(basic_var &other) noexcept
696 {
697 if (m_dispatcher != other.m_dispatcher && type() != other.type())
698 {
699 basic_var tmp;
700 tmp.move_store(*this);
701 move_store(other);
702 other.move_store(tmp);
703 }
704 else
705 m_dispatcher(operators::type::swap, this, (void *) &other);
706 }
707
708 template <typename T, typename store_t = cs_impl::var_storage_t<T>,
709 typename = std::enable_if_t<!std::is_same<store_t, basic_var>::value>>

Callers 15

tree_typeMethod · 0.70
tree_typeClass · 0.70
result op_swapMethod · 0.70
result op_swapMethod · 0.70
swapMethod · 0.70
anyMethod · 0.70
anyClass · 0.70
add_reserve_varMethod · 0.70
domain_typeMethod · 0.70
structureMethod · 0.70
structureClass · 0.70
swap_contextMethod · 0.50

Calls 3

move_storeFunction · 0.85
typeMethod · 0.80
typeEnum · 0.70

Tested by

no test coverage detected