File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ Change Log -- Ray Tracing in One Weekend
2727- Change: First image size changed to 256x256
2828- Change: Default image sizes changed from 200x100 to 384x216
2929- Change: Define image aspect ratio up front, then image height from that and the image width
30+ - Change: The C++ ` <random> ` version of ` random_double() ` no longer depends on ` <functional> ` header
3031
3132### _ The Next Week_
3233- Change: Large rewrite of the ` image_texture ` class. Now handles image loading too. (#434 )
Original file line number Diff line number Diff line change 12901290If you want to use this, you can obtain a random number with the conditions we need as follows:
12911291
12921292 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++
1293- #include < functional>
12941293 #include < random>
12951294
12961295 inline double random_double() {
12971296 static std::uniform_real_distribution< double> distribution(0.0, 1.0);
12981297 static std::mt19937 generator;
1299- static std::function< double()> rand_generator =
1300- std::bind(distribution, generator);
1301- return rand_generator();
1298+ return generator(distribution);
13021299 }
13031300 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13041301 [Listing [random-double-alt]: < kbd> [rtweekend.h]</ kbd> random_double(), alternate implemenation]
You can’t perform that action at this time.
0 commit comments