vendredi 26 février 2016

Is it possible to know if the parameter was defaulted

I have this function signature:

void do_somthing(std::vector<foo>&  bar={});

Is it possible to differ between those two calls for the function:

First:

do_something()

Second:

std::vector<foo> v;
do_something(v);

In other words, I want something like:

void do_somthing(std::vector<foo>&  bar={}){
    if(/* bar was defaulted*/){

    }
    else{

    }
}

EDIT: The actual code:

template<class Tinput_iterator>
            Tmodel perform_fitting(Tinput_iterator begin_data, Tinput_iterator end_data, std::vector<Tpoint>& inliers = {});

Aucun commentaire:

Enregistrer un commentaire