Announcement
Collapse
No announcement yet.
GCC Developers Look At Transitioning Their Codebase To C++11
Collapse
X
-
-
-
Originally posted by coder View PostOkay, so you mean manual deallocations. You can still use-after-free, with std::unique_ptr<>,
Originally posted by coder View PostIf I'm using an initializer list, then std::array<> forces me to redundantly specify the length as a template parameter.
Code:int vals[] = { 1, 2, 3 };
Code:[COLOR=#000000]std::array vals { [/COLOR][COLOR=#09885a]1[/COLOR][COLOR=#000000], [/COLOR][COLOR=#09885a]2[/COLOR][COLOR=#000000], [/COLOR][COLOR=#09885a]3[/COLOR][COLOR=#000000] };[/COLOR]
Comment
-
Originally posted by coder View PostAnyway, if you might need to erase, I think your best options are:- use iterators
- iterate by index (if randomly-accessible container)
- Likes 1
Comment
-
Originally posted by coder View PostHeh, you'll never be truly rid of macros. Just try writing assert() without using macros, to give one use case.Last edited by pal666; 01 October 2019, 01:09 PM.
Comment
-
Originally posted by cynical View PostAs a Lisp user, my mind boggles at how you C++ programmers survived without lambda expressions.
Originally posted by cynical View PostFor people who are curious, they are just unnamed procedures that evaluate to a value. (aka function expressions)
Originally posted by cynical View PostJavaScript also has a really fantastic syntax for them.
Code:const square = (x) => x * x
Originally posted by cynical View PostWhat do you mean? That book was fantastic! There is a similar tome for Java (I think it’s just called Effective Java) that is equally good, but reminds me precisely why I’d rather use Clojure than Java.
- Likes 1
Comment
-
Originally posted by tildearrow View PostSo there is no way to do it using the easily-readable syntax? Oh....
Originally posted by tildearrow View PostBecause I use clock_gettime since I think it takes less time to execute.
- Likes 1
Comment
Comment