Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>OK, for that particular example:</p> <ul> <li>you can get the time services from the standard library <a href="http://www.cplusplus.com/reference/clibrary/ctime/time/" rel="nofollow noreferrer">here</a></li> <li>you can use <a href="http://eigen.tuxfamily.org/dox-devel/QuickRefPage.html" rel="nofollow noreferrer">eigen</a> for linear algebra. It's an amazing library, I'm in love with it.</li> <li>check <a href="http://www.cplusplus.com/doc/tutorial/files/" rel="nofollow noreferrer">here</a> to learn how to manipulate files</li> </ul> <p>While using C++, you might miss some features from python, but most of them are actually provided by the <a href="http://www.boost.org/" rel="nofollow noreferrer">boost</a> libraries. For instance returning multiple values from a function is very easy with <a href="http://www.boost.org/doc/libs/1_49_0/libs/tuple/doc/tuple_users_guide.html" rel="nofollow noreferrer">boost.tuple</a> library as in <a href="http://www.boost.org/doc/libs/1_49_0/libs/tuple/doc/tuple_users_guide.html#tiers" rel="nofollow noreferrer">here</a>. You can use <a href="http://www.boost.org/doc/libs/1_49_0/libs/smart_ptr/shared_ptr.htm" rel="nofollow noreferrer">boost::shared_ptr</a> if you don't want to bother yourself with memory management. Or if you want to keep using python to play with your c++ classes, you can use <a href="http://www.boost.org/doc/libs/1_49_0/libs/python/doc/" rel="nofollow noreferrer">boost.python</a>. <a href="http://www.boost.org/doc/libs/1_49_0/libs/parameter/doc/html/index.html" rel="nofollow noreferrer">Boost.parameter</a> helps you define functions with named arguments. There is also <a href="http://www.boost.org/doc/libs/1_49_0/doc/html/lambda.html" rel="nofollow noreferrer">Boost.lambda</a> for lambda functions, but if your environment supports it, you can also use C++11 to have language support for lambda functions. Boost is a gold mine, never stop digging. Just assume that it's part of the standard library. I develop C++ in many different platforms, and neither eigen nor boost has let me down yet.</p> <p><a href="https://web.archive.org/web/20150519045338/http://www.parashift.com/c++-faq-lite/" rel="nofollow noreferrer">Here</a>'s a good FAQ for C++ best practices. <a href="http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization" rel="nofollow noreferrer">This</a> is a very important principle that you have to keep in mind at all times, while working in C++. I extend it a bit, in my mind and think; If you're going to do something dangerous such as: Allocate memory with a raw <code>new</code>, or index a raw C style array, pass around raw pointers, or do <code>static_cast</code> (even worse <code>reinterpret_cast</code>) etc. They should usually happen in a class somehow dedicated to them, and the code to make sure they don't cause trouble lives very close to them, so that you can see at a glance that everything is under control.</p> <p>Finally, my favourite!!! Do you want to keep using generators in C++? <a href="http://www.codeproject.com/Articles/29524/Generators-in-C" rel="nofollow noreferrer">Here</a>'s some dark magic.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload