C++Guns – RoboBlog

22.02.2019

C+ Guns: ACPL ownership transfer

Filed under: Allgemein — Tags: — Thomas @ 18:02

acpl::moveOwnership bietet im Gegensatz zu std::move den Vorteil, dass ein move-from const Variablen einen Fehler zur Compilezeit erzeugt. Zwei Beispiele sollen ownership transfer verdeutlichen. Daten in ein Type moven und dort speichern. Daten entweder kopieren oder durch eine Funktion moven. Move von const Variablen ist nicht möglich, da die Variablen geändert werden würden, was nicht […]

15.02.2019

C++ Guns: class template specialization with concepts aka C++20 std::ranges::value_type

Filed under: Allgemein — Tags: — Thomas @ 20:02

You can create a constrain for a class. And another constrain for the same class. Isn't this crazy stuff? With this we can build something like an identity function for types, like std::type_identity, for value_type. It's something like the C++17 non-member functions size() and empty(). Why must value_type be a member? It can be a […]

03.02.2019

C++ Guns: ACPL proudly presents: Histogram2D

Filed under: Allgemein — Tags: — Thomas @ 21:02

See also ACPL: Histogram1D ACPL: BinaryHeap Create even 2D Histogram in a fast and intuitive way. Define TWO access functions, Axis, Range, Titles, get stochastic moments for every dimension. Enjoy the 2D ASCII art output. See source code and more code examples at ACPL Histogram 2D City temperature VS air pressure Axis: temp [degree] Number […]

C++ Guns: ACPL proudly presents: Histogram1D

Filed under: Allgemein — Tags: — Thomas @ 21:02

See also ACPL: Histogram2D ACPL: BinaryHeap Create 1D Histogram in a fast and intuitive way. Define an Axis, Range, Title, get stochastic moments. Enjoy the ASCII art output. See source code and more code examples at ACPL Histogram 1D City temperature Axis: temp [degree] Number of bins: 50 bin width 0.242 Under/ Overflow count: 0 […]

30.01.2019

C++ Guns: C++20 Aggregates can no longer declare constructors (schon wieder anders...)

Filed under: Allgemein — Tags: — Thomas @ 21:01

Ab GCC 9. P1008 Prohibit aggregates with user-declared constructors Initialization in modern C++ - Timur Doumler - Meeting C++ 2018 Das Thema ist ziemlich lang und eigentlich total überflüssig. Wenn nicht immer die ganzen Altlasten da wären ... but we have to deal with it. Es gibt genügend Artikel im Internet wie gut oder schlecht […]

27.01.2019

C++ Guns: Stop using std::endl start using acpl::newline and std::clog std::cerr

Filed under: Allgemein — Tags: — Thomas @ 13:01

Schaut euch mal C++ Weekly - Ep7 Stop Using std::endl an. Eigentlich hat er ja recht, std::endl wird nicht gebraucht. Problem damit (wie immer), es macht mehr als man vermutet. Denn "end line" suggeriert nicht, dass nun ein Zeilenumbruch kommt und auch kein flush(). Das ganze hat bestimmt wieder historische Gründe. Jedenfalls gibt es neben […]

24.01.2019

Installing gcc, g++ and gfortran 8 from source

Filed under: Allgemein — Tags: , , , — Thomas @ 22:01

The procedure is quite the same as for gcc 4.8 as you can see in my older post Installing gcc, g++ and gfortran 4.8 from source Read the manual. Download, unpack, switch dir, download, unpack, link. $ wget ftp://ftp.gwdg.de/pub/misc/gcc/snapshots/LATEST-8/gcc-8-20190118.tar.xz $ xz -d gcc-8-20190118.tar.xz $ tar xf gcc-8-20190118.tar $ gcc-8-20190118/ $ wget ftp://ftp.gmplib.org/pub/gmp-6.1.2/gmp-6.1.2.tar.bz2 $ tar xjf […]

23.01.2019

C++ Guns: ACPL: Conway's Game of Life

Filed under: Allgemein — Tags: — Thomas @ 18:01

In den Heise Kommentaren (Ja ich schau da ab und zu rein) gab es letztens ein Vergleich zum Spaß von Conway's Game of Life einmal in C++ und GO. Natürlich war GO furchtbar langsam. Aber der C++ Code sah auch nicht sehr sinnvoll aus. Es ist an der Zeit es mit meinem ACPL Framework und […]

16.01.2019

C++ Guns: Interval

Filed under: Allgemein — Tags: — Thomas @ 15:01

Es gibt eine Menge Implementationen und Arbeit über Intervall Datentypen in C++, aber nichts, was einfach mal einfach wäre. Riesen Linksammlung http://www.cs.utep.edu/interval-comp/ Doc No: A Proposal to add Interval Arithmetic o the C++ Standard Library (revision 2) von 2008 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2137.pdf BOOST natürlich https://www.boost.org/doc/libs/1_69_0/libs/numeric/interval/doc/interval.htm Und sogar ein Versuch in ganz modernen C++ Moore: Interval Arithmetic in […]

15.01.2019

C++ Guns: How NOW to design FORTRAN -> C++ Interfaces

Filed under: Allgemein — Tags: , — Thomas @ 00:01

This is one wrong way to design a FORTRAN to C++ interface. But let's start at the beginning. From FORTRAN callable C++ function must be declared with extern "C" to disable name mangling. The function funcCPP expect a 2D array. Two items a 3 values. Calculate the sum and return it. Rember: C counts from […]

« Newer PostsOlder Posts »

Powered by WordPress