Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #11345

Re: Is this valid c++?

From Victor Bazarov <v.bazarov@comcast.invalid>
Newsgroups comp.lang.c++
Subject Re: Is this valid c++?
Date 2011-11-09 14:04 -0500
Organization A noiseless patient Spider
Message-ID <j9eism$efs$1@dont-email.me> (permalink)
References <d42e7802-cfd7-475f-88c5-b2b81b0e9c12@g27g2000pre.googlegroups.com> <j9e79n$qlb$1@dont-email.me> <slrnjblf6i.1bk.grahn+nntp@frailea.sa.invalid>

Show all headers | View raw


On 11/9/2011 12:48 PM, Jorgen Grahn wrote:
> On Wed, 2011-11-09, Richard Damon wrote:
>> On 11/9/11 10:29 AM, dec4106 wrote:
>>> Earlier today I came across a code example that looked something like
>>> this:
>>>
>>>
>>> template<typename T, unsigned S>
>>> class MyClass
>>> {
>>> public:
>>>       MyClass() = default;
>>>       ...
>>>
>>> "default" is not defined anywhere in the example.  I've never seen an
>>> expression like this before and don't understand how it could work,
>>> and haven't been able to make it work.  Is this a C++11 thing?
>>>
>>
>> Yes, that is a new C++11 construct, it tells the compiler to make a
>> standard default constructor MyClass() with the "default"
>> implementation, even if some other constructor is defined that would
>> suppress the generation of the default constructor.
>
> I hope this doesn't become the norm -- mixing C++11 into examples,
> discussions etc -- just yet. I bet most of us cannot switch, due
> to having to support some system which doesn't have a bleeding edge
> compiler yet.  (My Debian Stable systems have gcc 4.4, which
> implements maybe 50%.)
>
> C++11 is great, and it seems it will propagate out to the end users
> much faster than C++98 did ... but we have to survive while waiting
> for it, too.

And how long do you think we should wait?

V
-- 
I do not respond to top-posted replies, please don't ask

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Is this valid c++? dec4106 <dec4106@gmail.com> - 2011-11-09 07:29 -0800
  Re: Is this valid c++? Richard Damon <news.x.richarddamon@xoxy.net> - 2011-11-09 10:47 -0500
    Re: Is this valid c++? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-11-09 17:48 +0000
      Re: Is this valid c++? Victor Bazarov <v.bazarov@comcast.invalid> - 2011-11-09 14:04 -0500
        Re: Is this valid c++? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-11-10 20:20 +0000
          Re: Is this valid c++? Victor Bazarov <v.bazarov@comcast.invalid> - 2011-11-10 16:36 -0500
            Re: Is this valid c++? Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-11-12 08:29 +0000
  Re: Is this valid c++? Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2011-11-09 16:55 +0100
    Re: Is this valid c++? Krice <paulkp@mbnet.fi> - 2011-11-09 23:12 -0800
      Re: Is this valid c++? Juha Nieminen <nospam@thanks.invalid> - 2011-11-10 07:53 +0000
  Re: Is this valid c++? Daryle Walker <darylew@gmail.com> - 2011-11-13 02:26 -0800

csiph-web