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

Method swap

include/covscript/core/variable.hpp:869–878  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

867
868 public:
869 void swap(any &obj, bool raw = false)
870 {
871 if (this->mDat != nullptr && obj.mDat != nullptr && raw) {
872 if (mDat->protect_level != 0 || obj.mDat->protect_level > 0)
873 throw cs::runtime_error("The variable has been protected");
874 this->mDat->data.swap(obj.mDat->data);
875 }
876 else
877 std::swap(this->mDat, obj.mDat);
878 }
879
880 void swap(any &&obj, bool raw = false)
881 {

Callers 13

swapFunction · 0.45
entryMethod · 0.45
entryMethod · 0.45
parse_addasiMethod · 0.45
parse_subasiMethod · 0.45
parse_mulasiMethod · 0.45
parse_divasiMethod · 0.45
parse_modasiMethod · 0.45
parse_powasiMethod · 0.45
parse_asiMethod · 0.45
run_implMethod · 0.45
insert_or_assignFunction · 0.45

Calls 2

runtime_errorClass · 0.85
swapFunction · 0.70

Tested by

no test coverage detected