Skip to content

Commit 7c211c2

Browse files
authored
Update 10.2.concepts.cpp
1 parent 212f4f3 commit 7c211c2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

code/10/10.2.concepts.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct Person {
2929
double height, weight;
3030
Person(double a, double b) : height(a), weight(b) {}
3131
string to_string(){
32-
return "weight: "+ std::to_string(weight) + ", height: "+ std::to_string(height);
32+
return "weight: "+to_string(weight) + ", height: "+ to_string(height);
3333
}
3434
};
3535

@@ -56,21 +56,21 @@ string to_string(std::vector<int> v){
5656

5757

5858
void print(Stringable a){
59-
std::cout << a.to_string() << std::endl;
59+
cout << a.to_string() << endl;
6060
}
6161

6262
void print(HasStringFunc a){
63-
std::cout << to_string(a) << std::endl;
63+
cout << to_string(a) << endl;
6464
}
6565

6666
int main() {
67-
std::list<int> l {1, 2, 3};
67+
list<int> l {1, 2, 3};
6868
Person p(57, 170.0);
69-
std::vector<int> v { 34, 23, 34, 56, 78};
69+
vector<int> v { 34, 23, 34, 56, 78};
7070

7171
print(p); // uses concept Stringable
7272
print(l);
7373
print(3); // uses concept HasStringFunc
7474
// print(v); // error
7575
return 0;
76-
}
76+
}

0 commit comments

Comments
 (0)