lundi 3 août 2020

Is there any way to use curly braces as function parameters without including any other header file in C++?

My question is when i try to send something like {1,2,3,4,5} as parameter to a function, i have to use '''std::vector''' or '''std::initializer_list''' or a stl container. I searched this topic, everyone were using initializer_list or stl containers as function parameters for sending curly-brace arguments. I couldn't find any other way to do it. Is there any way of sending parameters as curly braces without adding a header file ?

Aucun commentaire:

Enregistrer un commentaire