4 ms·
The example presented in this post is neither a great example of what Rust can do nor an elegant solution to the particular problem of dealing with dates and ti
by maninalift 13y ago
The example presented in this post is neither a great example of what Rust can do nor an elegant solution to the particular problem of dealing with dates and times.
For a much further-reaching solution to this problem look at C++ user-defined literals, combined with what Bjarne Stroustrup calls "type rich programming".
now() + 3days + 21s + 102ms
This is not to say that c++ is the only language that can do this (although it does do it very well).
See the following video for a simple overview (apologies for toe-curling introduction):
http://channel9.msdn.com/Events/GoingNative/GoingNative-2012/Keynote-Bjarne-Stroustrup-Cpp11-Style http://channel9.msdn.com/Events/GoingNative/GoingNative-2012...
...also the video above is worth watching just for the vector vs. list comparison.