- "C++ Daddy Bjarne Stroustrup outlines directions for v17" - 1 Update
- Container that has iterators to itself in the value_type - 2 Updates
- Onwards and upwards - 2 Updates
- Member function template (was: Quick Newbie question) - 1 Update
- A C++ program - 1 Update
- void argument lists (was: operator (), what is it?) - 1 Update
Lynn McGuire <lmc@winsim.com>: Apr 28 05:59PM -0500 "C++ Daddy Bjarne Stroustrup outlines directions for v17" http://www.theregister.co.uk/2015/04/27/c_daddy_bjarne_stroustrup_outlines_directions_for_v17/ ""What will C++17 be?" B. Stroustrup, April 21, 2015 • Improve support for large-scale dependable software • Provide support for higher-level concurrency models • Simplify core language use, especially as it relates to the STL and concurrency, and address major sources of errors. • Preserve Fundamental strengths • A direct map to hardware (initially from C) • Zero-overhead abstraction (initially from Simula)" Lynn |
"Öö Tiib" <ootiib@hot.ee>: Apr 28 02:49PM -0700 On Tuesday, 28 April 2015 23:16:47 UTC+3, Marcel Mueller wrote: > The iterators are required to maintain a second independent sort order, > that only needs a linked list because it only requires the operations > pop_front and push_back. When there is need to have same elements to be indexed in several ways then you may want to consider one of: * Boost.Bimap * one base container, others containers of iterators to base container. * one base container, others Boost.Intrusive containers. * Boost.MultiIndex One of these choices performs likely close enough to optimal for your needs. |
Marcel Mueller <news.5.maazl@spamgourmet.org>: Apr 29 12:44AM +0200 On 28.04.15 22.33, Victor Bazarov wrote: >> pop_front and push_back. > What would your container contain if it only had one element? IOW, what > happens when it goes from empty to ??? upon the first insertion? The first entry gets end(). When the second entry is inserted the first one is changed to the iterator returned from the second insert and so forth. So the linked list keeps the insertion sequence to drop the oldest elements after a specified size has been reached. I only need to keep an iterator to the oldest element (head) for removal and one to the newest element (tail) for replacing end() of the last entry. Marcel |
woodbrian77@gmail.com: Apr 28 03:01PM -0700 Leigh, please don't swear here. I think most programs are servers now. After an exception is thrown, there are more requests to handle. Those who care about quality (e.g. robust and efficient exception handling) will care about this. Brian Ebenezer Enterprises - "Everyone who drinks of this water will thirst again; but whoever drinks of the water that I will give him shall never thirst; but the water that I will give him will become in him a well of water springing up to eternal life." John 4:13 and 14 http://webEbenezer.net |
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Apr 28 11:28PM +0100 > Leigh, please don't swear here. Why? "That's 28 fucks. Including that one 29. Ah fuck it make it 30." -- Paul Calf > thrown, there are more requests to handle. Those who care about > quality (e.g. robust and efficient exception handling) will care > about this. Bullshit; it makes no difference if a program is a server or not: exceptions should be thrown rarely not routinely so it matters little if creating an exception object involves an extra string allocation. > him shall never thirst; but the water that I will give him will > become in him a well of water springing up to eternal life." > John 4:13 and 14 Evolution falsifies your bible, religion and god. /Flibble |
Jorgen Grahn <grahn+nntp@snipabacken.se>: Apr 28 10:25PM On Tue, 2015-04-28, Paavo Helde wrote: >> of class member functions themselves being template member functions. > Yes, the class which it is a member of is a class template itself, so > what? And if your head starts to explode thinking of it, just pick a concrete example like std::list<int> and think of what its sort() functions would mean and what Compare could be. That's a "trick" I often use. /Jorgen -- // Jorgen Grahn <grahn@ Oo o. . . \X/ snipabacken.se> O o . |
legalize+jeeves@mail.xmission.com (Richard): Apr 28 09:44PM [Please do not mail me a copy of your followup] slp53@pacbell.net spake the secret code >In other words, write two makefiles (or worse, whatever VS uses), >have two completely distinct source bases or piles and piles of #ifdefs. >no thanks. It sounds like you don't have any experience with maintaining a cross-platform code base, even if "cross platform" just means "more varieties of Unix than a single linux distribution". The original poster's code compiled just fine in VS2013 with one exception. I didn't try it in VS 2015 community preview (also free), but I suspect it would handle the one exception just fine as well. If your code base is littered with #ifdef's, for whatever reason, chances are you're abusing the preprocessor and should use other superior abstraction mechanisms in C++ that have been there for decades. -- "The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline> The Computer Graphics Museum <http://computergraphicsmuseum.org> The Terminals Wiki <http://terminals.classiccmp.org> Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com> |
legalize+jeeves@mail.xmission.com (Richard): Apr 28 09:40PM [Please do not mail me a copy of your followup] slp53@pacbell.net spake the secret code >>will replace (void) argument lists with (), so you can kill off this >>C-ism from your code base in an automated and reliable way :-) >So you don't like it. That doesn't make it wrong. It's clutter. It needlessly increases cognitive load when reading code. >><http://reviews.llvm.org/D7639> >Hope it's optional. If you want to leave that clutter in your code, nothing is making you remove it. >IIRC, using void that way was introduced with C++, not with C. C++ had function overloading and always had type signatures and therefore writing int foo(void); is just a more verbose and cluttered way of writing int foo(); It was introduced into C when function prototypes were added. Prior to function prototypes, writing: int foo(); Declared a function named foo, with an unspecified number of arguments of unspecified types, returning an int. The only way to properly declare a function taking no arguments in C is to write: int foo(void); The *only* place where writing (void) is important is C. That's why it's a C-ism. Bjarne Stroustrup recommends that you simply write 'int foo()' and I do too. My addition to clang-tidy turns that advice into an automated robot that can clean up that clutter in your code base all the time without you having to do it in an error-prone manual way. If you like hoarding unnecessary tokens in your code, then by all means, keep them. -- "The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline> The Computer Graphics Museum <http://computergraphicsmuseum.org> The Terminals Wiki <http://terminals.classiccmp.org> Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com> |
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page. To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com. |
No comments:
Post a Comment