I am used to angle brackets being used to specify a type, as a parameter:

vector<int> vecOfInts ;

But in rapidjson, there is code like this:

document.Parse<0>(json) ;

The document.Parse method's signature is:

template <unsigned parseFlags>
GenericDocument& Parse(const Ch* str) {
    RAPIDJSON_ASSERT(!(parseFlags & kParseInsituFlag));
    GenericStringStream<Encoding> s(str);
    return ParseStream<parseFlags>(s);
}

I didn't know you could pass a value inside angle brackets - thought angle brackets were used for typenames alone.

What is the code here doing, and why is he passing a value in the angle brackets?

Is this a good idea? When?

Edit
Report