mardi 14 novembre 2017

C++ : prim() in an "if statement"

While studying the C++ programming language by B. Stroustrup, it has been mentioned the existence of the prim() functions which reduces the scope of the declared variable to one single block.

This is an example provided by the book:

if (double d = prim(true)) {
    left /= d;
    break;
}

Despite understanding its interest, I cannot figure out how to use it: is it part of a certain library ? Of must I precise the standard because Visual Studio isn't able to recognise the function.

Thanks in advance

Aucun commentaire:

Enregistrer un commentaire