Part 1: print std::array with std::integer_sequence Part 2: convert tuple to parameter pack Part 3: print std::array with std::apply and fold Part 4: fold over std::tuple und erzeugten Assembler Code Part 5: fold over std::tuple of std::vector of Types ... Part 6: apply generic lambda to tuple Part 7: Play with std::tuple and std::apply Okay […]
13.06.2018
C++ Guns: fold over std::tuple of std::vector of Types ...
C++ Guns: nächste darstellbare Gleitkommazahl : std::nextafter
std::nextafter(Arithmetic from, Arithmetic to) Returns the next representable value of from in the direction of to. Die nächste Zahl nach 1.0f ist dann 1.0000001192092895508. Hab das mal für eine Reihe von Zahlen mir ausgeben lassen. Und nicht nur die nächste Zahl, sondern bis zu 1000 nächst Zahlen. Hier das Programm für C++: Und hier das […]
05.06.2018
C++ Guns: fold over std::tuple und erzeugten Assembler Code
Part 1: print std::array with std::integer_sequence Part 2: convert tuple to parameter pack Part 3: print std::array with std::apply and fold Part 4: fold over std::tuple und erzeugten Assembler Code Part 5: fold over std::tuple of std::vector of Types ... Part 6: apply generic lambda to tuple Part 7: Play with std::tuple and std::apply Hier […]
02.06.2018
C++ Guns: convert tuple to parameter pack
Part1: print std::array with std:integer_sequence Part2: convert tuple to parameter pack Part 3: print std::array with std::apply and fold Part 4: fold over std::tuple und erzeugten Assembler Code Part 5: fold over std::tuple of std::vector of Types ... Part 6: apply generic lambda to tuple Part 7: Play with std::tuple and std::apply Guckst du hier […]
C++ Guns: print std::array or std::tuple with std::apply and fold
Part 1: print std::array with std:integer_sequence Part 2: convert tuple to parameter pack Part 3: print std::array or std::tuple with std::apply and fold Part 4: fold over std::tuple und erzeugten Assembler Code Part 5: fold over std::tuple of std::vector of Types ... Part 6: apply generic lambda to tuple Part 7: Play with std::tuple and […]
01.06.2018
C++ Guns: Ein Paar Würfel
Ich möchte zum Spaß ein Wüfelspiel programmieren. Dazu müssen einzelne Würfel implementiert werden. Doch was ist ein Würfel eigentlich? Offensichtlich ein Zufallszahlengenerator z.B. std::minstd_rand. Aber ein Würfel repräsentiert auch eine Gleichverteilung Ganzer Zahlen im Bereich von z.B. 1 bis 6. Und ein Würfel hat ein Status, seine Augenzahl. Die ändert sich ja nicht, egal wie […]