dimanche 13 mai 2018

Empty angle brackets on user defined types

There are only 2 use cases known to me for empty angle brackets <> in c++ templates, which are encountered:

1) During template full specialization e.g.

template<typename T>
class X
{};

template<>
class X<char>
{};

2) During the templated function call which argument type's can be deduced e.g.

template<typename T>
T add(T a, T b);

...  

add<>(1, 2);

But this case is completely new to me, and I can't understand the meaning of such syntax (please have a look at rapidxml::xml_node<>*):

class TestWidget : public GUI::Widget
{
public:
    TestWidget(const std::string& name, rapidxml::xml_node<>* elem);
    // ...
};

What semantics are given to the xml_node<> type here in the constructor parameter ???

Aucun commentaire:

Enregistrer un commentaire