Hello, there is such code (UnicodeString is a string from c ++ builder):

struct CTestParams { int TestDelay; double TglTest; double DtTglTest; int NumberVsi; int View; int NumberChannel; std::string Name; }; class CTest { public: template<typename...Arg> CTest(Arg&&...args) { std::tuple<Arg...> tl { std::forward<Arg>(args)... }; std::tie(testFolder, mimsFolder, resultFolder, nameTest, params) = tl; } CTest() : CTest_base(), mimsFolder(), nameTest(), resultFolder(), params() {} private: UnicodeString testFolder; UnicodeString mimsFolder; UnicodeString nameTest; UnicodeString resultFolder; CTestParams params; }; class CP { public: void set_data(const CTest& elem) { data = elem; } void set_dummy_test() { set_data(CTest {"...","...","...","...", CTestParams{} }); } private: CTest data; }; int main() { CP cp; cp.set_dummy_test(); } 

a bunch of errors crashes in the string with std :: tie ... what could be wrong here? errors:
ctest.h (35): in instantiation of function template specialization 'std :: tuple :: operator =' requested here

[bcc64 Error] tuple (365): no viable overloaded '='

tuple (495): function const _Mybase ’(for aka con const tuple <>’) to con const _ Myt ’(aka con const tuple ') for the 1st argument;

compiler c ++ builder x64

  • one
    Show a bunch of errors. - gbg
  • Here, let's say: ctest.h (35): Instantiation of function template specialization 'std :: tuple :: operator = <testModel :: CTest> 'requested here [bcc64 Error] tuple (365): no viable overloaded' = 'tuple (495): candidate function not viable: no cond _Mybase' (aka 'const tuple <> ') to' const _Myt '(aka' const tuple <System :: UnicodeString &, System :: UnicodeString &, System :: UnicodeString &, CTestParams &> ') for 1st argument; - xperious
  • one
    Try explicitly passing UnicodeString when calling CTest , i.e. CTest { UnicodeString("..."), ... , etc. But in general, is a template constructor really needed here? - αλεχολυτ
  • one
    as it turned out, on vs2013, for example, it compiles fine ... this is the builder's compiler bug ... although there I replaced unicodestring with std :: string ... but unicodestring does not have an explicitly defined move constructor (at least I did not find it) Maybe this is the case - xperious

0