1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| #include<iostream>
#include<vector>
#include <iterator>
#include <algorithm>
#include <functional>
struct Inputs{
double variable1;
double variable2;
double variable3;
};
void setupExemple (Inputs &i){
i.variable1 = 2;
i.variable2 = 3;
i.variable3 = 4;
}
void ma_fonction (const Inputs &i){
std::vector<double>variable4;
for (double c = 0.6; c < 1; c= c+0.1){
variable4.push_back(c);
};
double const v0 = i.variable1+i.variable2+i.variable3;
std::transform(variable4.begin(),variable4.end(),
std::ostream_iterator<double>(std::cout,"\n")
,std::bind1st(std::plus<double>(),v0)
);
}
int main (){
Inputs i;
setupExemple (i);
ma_fonction (i);
return 0;
} |