oopscenities.net
C++11: C++-style listener list | On C++ and other OOPscenities
https://oopscenities.net/2011/07/31/c0x-c-style-listener-list
On C and other OOPscenities. C 11: C -style listener list. Consider you want to create a class where you can register a set of listeners to be notified when something occurs. For example, this is a class that performs some task and you want to be notified when the task has been completely executed. See this code in Java:. How would you implement it in C? So how would the C way of doing this be? First, let’s implement the caller. Using C 0x lambdas, it could be as simple as:. Class Task { private: vector ...
oopscenities.net
C++11: std::future and std::async | On C++ and other OOPscenities
https://oopscenities.net/2013/01/04/c11-stdfuture-and-stdasync
On C and other OOPscenities. C 11: std: future and std: async. C 11 introduces support for asynchronous calls in a very easy way. The standard library provides the mechanisms to perform those asynchronous calls and store the results until the caller will actually need them. Look at this piece of code:. To compile this (in a Linux system, using gcc 4.7 in my case; I know that it works on Visual Studio 2012 too): you need to invoke the g compiler in this way:. Reversing Roma tibi subito motibus ibit amor.
oopscenities.net
Project X | On C++ and other OOPscenities
https://oopscenities.net/2011/10/08/project-x
On C and other OOPscenities. This is an amazing video created by a friend. Or with subtitles in English:. C : Primitive types. C : Smart pointers, part 1 →. 2 thoughts on “ Project X. Created by a friend and with a magic (in music) of my personal beatle (you). Thanks Mr. “Director of Project X” :) But my sounds are just a tiny part of all the work! The real credits are just yours! Leave a Reply Cancel reply. Enter your comment here. Fill in your details below or click an icon to log in:. C 11: std: tuple.
oopscenities.net
C++: Primitive types | On C++ and other OOPscenities
https://oopscenities.net/2011/09/28/c-primitive-types
On C and other OOPscenities. C : Primitive types. A primitive type is a data type where the values that it can represent have a very simple nature (a number, a character or a truth-value); the primitive types are the most basic building blocks for any programming language and are the base for more complex data types. These are the primitive types available in C :. It is stored internally in one byte and the values of this type can be only true. And any value different than 0 represents true. Represents a...
oopscenities.net
Music: Introducing “poiesis” again and again | On C++ and other OOPscenities
https://oopscenities.net/2015/03/21/introducing-poiesis-again-and-again
On C and other OOPscenities. Music: Introducing “poiesis” again and again. Today I am publishing again “Poiesis”. It is available in these sites:. Though I composed this work on 1997; I am publishing it again with a lot of improvements and some changes:. Modernized the sound a little bit. Removed a lot of noises and effects. Replaced several sampled instruments by AudioUnits. Started to use Renoise instead of OpenMPT and Impulse Tracker. Equalized, mixed and remastered again and again. El libro de la vida.
oopscenities.net
C++11: enable_if | On C++ and other OOPscenities
https://oopscenities.net/2012/06/02/c11-enable_if
On C and other OOPscenities. C 11: enable if. Is another feature taken from the Boost C library that now ships with every C 11 compliant compiler. As its name says, the template struct. This feature works nicely with SFINAE. Let’s consider the example of the post about SFINAE:. Template typename T struct has iterator { template typename U static char test(typename U: iterator* x); template typename U static long test(U* x); static const bool value = sizeof(test T (0) = 1; };. So, how could I implement the.
oopscenities.net
Mercurial: StatHG is alive! | On C++ and other OOPscenities
https://oopscenities.net/2012/03/15/mercurial-stathg-is-alive
On C and other OOPscenities. Mercurial: StatHG is alive! A bunch of colleagues and friends were very busy developing this very nice tool that lets you get nice reports from Mercurial. Taken from the project web page:. StatHg generates statistical report graphs from the Mercurial activity log. The generated report is independent of the application and can be freely transferred or even published using a web server. This version includes the following reports:. Graphs by Project (repository). C 11: Smart Po...
oopscenities.net
C++11: std::thread | On C++ and other OOPscenities
https://oopscenities.net/2012/11/16/c11-stdthread-2
On C and other OOPscenities. C 11: std: thread. The standard library that ships with the new C 11 contains a set of classes to use threads. Before this, we needed to use the OS specific thread facilities each OS provides making our programs hard to port to other platforms. This thread: sleep for(). Method, for example). Microsoft Visual Studio 2012 ships with good thread support. To define a thread, we need to use the template class. In my example you can see several things:. In the thread function:.
oopscenities.net
C++: Smart pointers, part 1 | On C++ and other OOPscenities
https://oopscenities.net/2011/10/14/c-smart-pointers
On C and other OOPscenities. C : Smart pointers, part 1. This is the first of several posts I wrote related to smart pointers:. More on unique ptr. Memory management in C is too error prone because keeping track of each bunch of bytes allocated and deallocated can be really confusing and stressing. Although C has the same manual memory management than C, it provides us some additional features that let us to do this management easier:. When an object is instantiated in the stack (e.g. Number is 2, the pr...
oopscenities.net
C++11: Perfect forwarding | On C++ and other OOPscenities
https://oopscenities.net/2014/02/01/c11-perfect-forwarding
On C and other OOPscenities. C 11: Perfect forwarding. Consider this function template. That invokes the function/functor/lambda expression passed as argument passing it the two extra arguments given:. Nice, it works as expected and the result is:. The problem with my implementation is that it only works with arguments passed as constant references, so if I would like to invoke this function:. Void successor(int a, int& b) { b = a 1; }. Int s = 0; invoke(successor, 10, s); cout s endl;. Function template...