Groups | Search | Server Info | Login | Register


Groups > comp.lang.c++.moderated > #7391

Re: Isn't it better using Qt than the 'standerd' C++?

Message-ID <41579872-a09e-4b8a-ad50-b93a1087e831@googlegroups.com> (permalink)
Newsgroups comp.lang.c++.moderated
From Öö Tiib <ootiib@hot.ee>
Subject Re: Isn't it better using Qt than the 'standerd' C++?
Organization unknown
References <e248e0ec-fe34-4c49-b2c1-1649fb9a6c39@googlegroups.com> <napa7j$qaa$1@dont-email.me> <90c1b4be-8d0c-452e-b64b-22d36e535798@googlegroups.com> <0f65d969-285f-4ab4-80de-016421752653@googlegroups.com> <fac53216-3494-40ec-8114-3c1cff524a7b@googlegroups.com>
Date 2016-03-04 06:44 -0600

Show all headers | View raw


On Thursday, 3 March 2016 14:30:20 UTC+2, w...@totalbb.net.tw  wrote:
> On Thursday, March 3, 2016 at 1:10:16 AM UTC+8, Martin Bonner wrote: 
> 
> > one can have standard containers which contain resource handling objects
> > (so can't be sensibly copied, but can be moved).
> > 
> 
> This is a major reason rref tried to solve.

It not only "tried" but solved that. Copying lot of things does not make
sense but moving some of those (like a thread or a file descriptor) 
makes sense. So now if we make classes that contain such things movable
then we can use those in 'std::vector' or 'std::deque'.

> 
> > It does add complexity to the type system (although I'm not convinced 
> > by x2),
> 
> Let's say. If adding a lllong int, many should be considered, type
> casting ,promotion, literals, i/o... that just one type (just mention
> something I knew, could not be the right term for C++ compiler)
> Adding rref?
> It can be applied to all types, present or future. At least, every class,
> about half of the members have the burden how to treat rref the right way
> whether you like it or not. 

Only the classes that manage resources of members "manually" (so have
user-written destructor) *and* that makes sense to make movable *and*
that developer wants to make movable need to have two additional 
members: move constructor and move assignment operator.

That is rather rare need since classes that manage resources of members
dynamically and "manually" are rare.

> Template class has more cases to think about, no matter you like it or
not.

As far as C++ is concerned there are no "template class" there is only
"class template" that is "template for a class". Most difficult about 
class templates is to validate the template arguments to be fitting in
a way that the diagnostics make sense. Otherwise those are quite similar
to other classes.

> As general variable, wondering how many cases is rref useful? how many
> can causing negative effects? (I don't use rref, no big deal to work
around)

If you don't use move then all works like in C++03. No complexity added
whatsoever. Then is hard to understand what you complain about.

> There are many cases where rref are not so good and had to be considered
> ,and that triggered a language 'taboo': A language feature, particularly
> the core part, should consider not only the desirable part, but all the
> cases generated. A good language feature should in principle not enter
> this 'taboo' area where that feature is so undesirable and should be
> 'disabled' (C++2011 provided a 'nice' delete)...

I do not understand what 'taboo' was violated. Feature that was missing
and was painful to implement manually (the move) was added. Dangerous 
extension of Microsoft compilers (those accepted temporaries as 
arguments for reference to non-const parameters) was made pointless 
so VS 2015 now finally warns about that.


-- 
      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

Back to comp.lang.c++.moderated | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Isn't it better using Qt than the 'standerd' C++? wij@totalbb.net.tw - 2016-02-25 08:26 -0600
  Re: Isn't it better using Qt than the 'standerd' C++? Martin Bonner <martinfrompi@yahoo.co.uk> - 2016-02-25 09:20 -0600
  Re: Isn't it better using Qt than the 'standerd' C++? Wouter van Ooijen <wouter@voti.nl> - 2016-02-25 09:46 -0600
  Re: Isn't it better using Qt than the 'standerd' C++? Francis Glassborow <francis.glassborow@btinternet.com> - 2016-02-26 06:47 -0600
    Re: Isn't it better using Qt than the 'standerd' C++? wij <wij@totalbb.net.tw> - 2016-03-02 06:34 -0600
      Re: Isn't it better using Qt than the 'standerd' C++? Martin Bonner <martinfrompi@yahoo.co.uk> - 2016-03-02 11:07 -0600
        Re: Isn't it better using Qt than the 'standerd' C++? wij@totalbb.net.tw - 2016-03-03 06:27 -0600
          Re: Isn't it better using Qt than the 'standerd' C++? Öö Tiib <ootiib@hot.ee> - 2016-03-04 06:44 -0600
            Re: Isn't it better using Qt than the 'standerd' C++? wij@totalbb.net.tw - 2016-03-05 06:58 -0600
      Re: Isn't it better using Qt than the 'standerd' C++? Öö Tiib <ootiib@hot.ee> - 2016-03-03 06:27 -0600
        Re: Isn't it better using Qt than the 'standerd' C++? legalize+jeeves@mail.xmission.com (Richard) - 2016-03-04 11:01 -0600
          Re: Isn't it better using Qt than the 'standerd' C++? Öö Tiib <ootiib@hot.ee> - 2016-03-05 06:57 -0600
  Re: Isn't it better using Qt than the 'standerd' C++? wij@totalbb.net.tw - 2016-02-26 06:47 -0600
    Re: Isn't it better using Qt than the 'standerd' C++? Öö Tiib <ootiib@hot.ee> - 2016-02-26 09:31 -0600
      Re: Isn't it better using Qt than the 'standerd' C++? "James K. Lowden" <jklowden@speakeasy.net> - 2016-02-26 15:46 -0600
        Re: Isn't it better using Qt than the 'standerd' C++? legalize+jeeves@mail.xmission.com (Richard) - 2016-02-26 19:29 -0600
        Re: Isn't it better using Qt than the 'standerd' C++? Öö Tiib <ootiib@hot.ee> - 2016-02-27 07:16 -0600
  Re: Isn't it better using Qt than the 'standerd' C++? Cholo Lennon <chololennon@this.is.invalid> - 2016-02-26 09:30 -0600

csiph-web