G33X Nexus Entertainment

G33X Nexus Entertainment => Current Projects => RaptorNL => Topic started by: whitelynx on October 21, 2006, 12:50:32 pm

Title: [OT] Interesting programming articles
Post by: whitelynx on October 21, 2006, 12:50:32 pm
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 (http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.18).
Title: Re: [OT] Interesting programming articles
Post by: whitelynx on October 21, 2006, 04:07:59 pm
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/ (http://predef.sourceforge.net/).
Title: Re: [OT] Interesting programming articles
Post by: whitelynx on October 22, 2006, 04:40:17 am
Just browsing through the Boost docs, and I came across a very interesting type, boost::any (http://boost.org/doc/html/any/s02.html). 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.