Archive for the ‘cpp’ Category
Bitwise binary search
Posted on: 01/04/2013
- In: cpp
- Leave a Comment
A new post has been posted at: http://efesx.com/2013/04/01/bitwise-binary-search/
Python directing C++
Posted on: 30/09/2012
- In: cpp
- Leave a Comment
A new post has been posted at: http://efesx.com/2012/09/30/python-directing-cpp/
Unexpected skip of a destructor
Posted on: 31/07/2012
- In: cpp
- Leave a Comment
A new post has been posted at: http://efesx.com/2012/07/31/unexpected-skip-of-a-destructor/
Preloading a segfault
Posted on: 26/05/2012
- In: cpp
- Leave a Comment
A new post has been posted at: http://efesx.com/2012/05/26/preloading-a-segfault/
Bounded size priority queue
Posted on: 30/04/2012
- In: cpp
- Leave a Comment
A new post has been posted at: http://efesx.com/2012/04/30/bounded-size-priority-queue/
Imitation of Java Generics
Posted on: 31/12/2010
- In: techniques
- 6 Comments
Generic programming is very common and has different names (and features) in various programming languages; C++ provides Turing-Complete Templates, Java offers Generics (along with Ada, Eiffel, C#, and Visual Basic .Net), and Parametric Polymorphism is present in ML, Scala, and Haskell.
While I am generally pretty happy with what C++ has to offer, adopting some of the features offered by other mechanisms can come in handy sometimes. To be more specific, in this post we will mimic Java’s support for defining an upper bound for generic elements (i.e. List<T extends Comparable>).
Exceptional initialization list
Posted on: 30/11/2010
- In: mechanisms
- 9 Comments
Using the initialization list is very much encouraged in C++, and rightfully so – it has many benefits. But what happens if one of your members fails at initialization and actually throws an exception? Even worse: what happens if that member’s constructor throws an exception not in your exception specification list?
Recent comments