G33X Nexus Entertainment > RaptorNL

[OT] Interesting programming articles

(1/1)

whitelynx:
A very interesting thing I just came across is something called "the Named Parameter Idiom". Basically, it allows C++ to have something similar to Python's keyword arguments. (things like func(foo="boo!", bar=3) in Python) The article can be found at http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.18.

whitelynx:
Another very useful site I just came across is one which lists all the predefined macros in almost any compiler you can think of. This is very useful for telling what architecture, compiler, or environment you're using. It can be found at http://predef.sourceforge.net/.

whitelynx:
Just browsing through the Boost docs, and I came across a very interesting type, boost::any. It is basically a variant type that's a hell of a lot safer than a union. (and more flexible i believe) On the examples page, they also have an example of a key/value pair class with boost::any as the 'value' type, allowing you to set arbitrarily-typed values.

Navigation

[0] Message Index

Go to full version