rttrorg / rttr

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

how to get start address of vector's first element ? #277

Open bruceauyeung opened 4 years ago

bruceauyeung commented 4 years ago

i have already registered like this:

    registration::class_<std::vector<char*>>("std::vector<char*>")
        .constructor<std::vector<char*>::size_type>()
        (
            policy::ctor::as_std_shared_ptr
        );

and then i created a vector and assign each element like this:

type charPtrArray = type::get_by_name("std::vector<char*>");
auto charPtrArrayInst = charPtrArray.create({ size });
auto charPtrArrayInstView = charPtrArrayInst.create_sequential_view();
int i = 0;
for (const auto& item : view)
{
    charPtrArrayInstView.set_value(i, item.second.extract_wrapped_value().to_string().c_str());
    i++;
}

now how can i get start address ( expecting const char ** ) of the underlying vector of charPtrArrayInst ?

@acki-m please help me out, thanks a lot!