samedi 21 septembre 2019

any reason behind the syntax of shared pointer with custom class with template like below

I am currently seen some c++11 code in the project , where i got little confused with some funky syntax.

below is the code

std::shared_ptr<CommonAPI::Runtime> runtime_AMB = CommonAPI::Runtime::get();
std::shared_ptr<v1::org::table::psa::EthernetProxy<>> amb_consumer ;
amb_consumer = runtime_AMB->buildProxy<v1::org::table::psa::EthernetProxy>();

Here my doubt is "buildProxy" function, it can be simply called why its mention like

buildProxy<v1::org::table::psa::EthernetProxy>() instead of buildProxy()

One more doubt is shared_ptr<v1::org::table::psa::EthernetProxy<>> here why EthernetProxy<> instead just like v1::org::table::psa::EthernetProxy

May be its easy but i am not aware of c++11 thatmuch

Aucun commentaire:

Enregistrer un commentaire