Skip to content

Commit 40d37df

Browse files
committed
Make it clearer which code is C++
1 parent 0ec1241 commit 40d37df

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎cpp-hypot-overload/src/bin/cpp-hypot-overload.rs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ impl HypotArgs for (c_double, c_double) {
2828
let (x, y) = self;
2929
unsafe {
3030
cpp!([x as "double", y as "double"] -> c_double as "double" {
31+
// This is C++ code!
3132
return std::hypot(x, y);
3233
})
3334
}
@@ -69,8 +70,6 @@ impl HypotArgs for (c_int, c_int, c_int) {
6970
let (x, y, z) = self;
7071
unsafe {
7172
cpp!([x as "int", y as "int", z as "int"] -> c_double as "double" {
72-
// C++ instantiates the `std::hypot<int, int, int>` template, which casts to
73-
// `double` before calling `std::hypot(double, double, double)`.
7473
return std::hypot(x, y, z);
7574
})
7675
}

0 commit comments

Comments
 (0)