rttrorg / rttr

C++ Reflection Library
https://www.rttr.org
MIT License
3.12k stars 430 forks source link

get_by_name("custom name") function does not return expected type in centos 7 #284

Open bruceauyeung opened 4 years ago

bruceauyeung commented 4 years ago

rttr version: master header the problem happens in centos 7 64bit, gcc: 4.8.5. works well in windows 7.

for example, i register a type like this:

registration::class_<std::vector<MyClass*>>("std::vector<MyClass*>")
    .constructor<std::vector<MyClass*>::size_type, std::vector<MyClass*>::value_type>()
    (
            policy::ctor::as_raw_ptr,
            default_arguments((MyClass*)NULL)
    );

when i do type::get_by_name("std::vector<MyClass*>"), i get invalid type in centos 7, but get expected type in windows 7.

so i tried to figure out what happened under the hood.

for(const auto& t : type::get_types()){
    cout << t.get_name() <<std::endl;  
   // print std::vector<MyClass*,std::allocator<MyClass*>> in centos 7 which is not expected.
}

this looks like custom name does not work while registering a class. @acki-m