问题
I am coming from c to c++ and familiar with the syntax. But I just came across the code with syntax im not familiar with
int main() {
std::shared_ptr < CommonAPI::Runtime > runtime = CommonAPI::Runtime::get();
std::shared_ptr<HelloWorldProxy<>> myProxy =
runtime->buildProxy<HelloWorldProxy>("local", "test");
Can Someone explain what does syntax something < something > something
do also what does syntax something<something<>> something
do.
回答1:
You're looking at C++ templates.
...allows a function or class to work on many different data types without being rewritten for each one.
来源:https://stackoverflow.com/questions/42962113/confusing-angle-brackets-something-in-c