Skip to content

Commit 5c61706

Browse files
Merge pull request #18 from contour-terminal/improvement/godbolt_examples
Better godbolt examples
2 parents e30326c + 145ecee commit 5c61706

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ double value_d = speed_of_light * 2.0;
7171

7272

7373
# Another examples
74-
You can create functions that will automatically adjust order of parameters. [godbolt](https://godbolt.org/z/n8Ez5K6vq)
74+
You can create functions that will automatically adjust order of parameters. [godbolt](https://godbolt.org/z/roar9468x)
7575

7676
``` c++
7777
using rho_type = boxed::boxed<double>;
@@ -103,13 +103,12 @@ int main() {
103103
theta_type theta{3.14 / 3.0};
104104
phi_type phi{3.14 / 2.0};
105105

106-
std::cout << x_coord(rho, theta, phi) << std::endl;
107-
std::cout << x_coord(phi, theta, rho) << std::endl;
108-
std::cout << x_coord(rho, phi, theta) << std::endl;
106+
x_coord(rho, theta, phi) == x_coord(phi, theta, rho);
107+
x_coord(rho, theta, phi) == x_coord(theta, phi, rho);
109108
}
110109
```
111110
112-
Or using another approach: [godbolt](https://godbolt.org/z/fjhaaT5hh)
111+
Or using another approach: [godbolt](https://godbolt.org/z/rn1f4xbd6)
113112
114113
``` c++
115114
using rho_type = boxed::boxed<double>;
@@ -149,9 +148,8 @@ int main() {
149148
theta_type theta{3.14 / 3.0};
150149
phi_type phi{3.14 / 2.0};
151150
152-
std::cout << x_coord(rho, theta, phi) << std::endl;
153-
std::cout << x_coord(phi, theta, rho) << std::endl;
154-
std::cout << x_coord(rho, phi, theta) << std::endl;
151+
x_coord(rho, theta, phi) == x_coord(phi, theta, rho);
152+
x_coord(rho, theta, phi) == x_coord(theta, phi, rho);
155153
}
156154
```
157155

0 commit comments

Comments
 (0)