2

I am trying to use typedef std::tuple<double, double> location_t; to create a simple tuple with latitude and longitude, but eosiocpp gives me

2018-09-02T12:54:47.310 thread-0   main.cpp:105                  main                 ] 999999 abi_generation_exception: Unable to generate abi
total_bases == 0: Multiple inheritance not supported - std::tuple<double, double>::_BaseT
    {"type":"std::tuple<double, double>::_BaseT"}
    thread-0  abi_generator.cpp:655 add_struct

    {}
    thread-0  abi_generator.cpp:312 handle_decl

How should I declare tuple instead?

2 Answers 2

1

Multiple inheritance not supported for this particular case means that you can only have a tuple of single type.

typedef std::tuple<double> location_t;

According to this answer one is not able to use tuple.

Can somebody also confirm that this is the case?

Just replaced tuple with struct to avoid this headache. It's weird that tuple is used throughout eos code, but wasm can't handle it.

0

Since you are using 2 values of the same type, why not use a std::vector ? This one can also be described in your ABI, say you want a vector of double, in your .abi you would define it as follows:

double[]

while in your c++ you would find

std::vector<double>

Unsure if it fits perfectly as you can't define a number of columns here, but may be worth a try.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.