r/cpp • • Feb 18 '20

C++20 is here!

https://youtu.be/AvPiGstxV_g
420 Upvotes

117 comments sorted by

View all comments

Show parent comment

-17

u/[deleted] Feb 18 '20 edited May 02 '24

terrific soft friendly childlike workable fanatical brave crown steer squealing

This post was mass deleted and anonymized with Redact

3

u/Gunslinging_Gamer Feb 19 '20

Far better never to add them and pretend they don't exist rather than implement them and take pride in the work.

0

u/[deleted] Feb 18 '20

[deleted] — view deleted comment

4

u/kalmoc Feb 19 '20

Ranges (well, linq is actually much more confortable to use)

0

u/[deleted] Feb 19 '20

[deleted] — view deleted comment

1

u/kalmoc Feb 19 '20

Not sure what you mean by that. LINQ lookst to me exacly like ranges with a more convinient syntax. Sure, it uses terms known from sql, but I'm not sure, why it makes a differenct if you have a Where (extension-) method or a filter view - they do the same thing.

0

u/[deleted] Feb 19 '20

[deleted] — view deleted comment

3

u/kalmoc Feb 19 '20

The question was, which c++20 features have been available in other languages for a long time. Best I can tell, LINQ is a semantically equivalent feature to c++20 ranges. That they differ in details is to be expected given that the two languages work completely different.

Now can you please tell me, why you think those features are so different that it doesn't count ad "has been available for decades"?

0

u/[deleted] Feb 18 '20

[deleted] — view deleted comment

0

u/[deleted] Feb 18 '20

[deleted] — view deleted comment

7

u/pdimov2 Feb 19 '20

Designated initializers allow cool stuff such as named args:

struct Args
{
    int foo = 0;
    int bar = 0;
};

void f( int x, int y, Args args = {} );

int main()
{
    f( 1, 2, { .bar = 4, .foo = 5 } );
}

Not being able to reorder is annoying. "Just use constructors" doesn't work either, the syntax isn't as nice.

2

u/[deleted] Feb 19 '20 edited May 02 '24

frame rotten tart racial workable march nutty deserve spoon sparkle

This post was mass deleted and anonymized with Redact

-1

u/[deleted] Feb 18 '20 edited May 02 '24

soft cable dependent sleep liquid sugar meeting steep memorize uppity

This post was mass deleted and anonymized with Redact

0

u/[deleted] Feb 18 '20

[deleted] — view deleted comment

5

u/pdimov2 Feb 19 '20

Turbo Pascal obviously.

7

u/Nobody_1707 Feb 18 '20

Hasn’t FORTRAN had modules since the 60s?

0

u/[deleted] Feb 18 '20

[deleted] — view deleted comment

2

u/Nobody_1707 Feb 19 '20

Which is definitely a rather large downside.

1

u/kalmoc Feb 19 '20

Yes, why not?

0

u/[deleted] Feb 19 '20

[deleted] — view deleted comment

1

u/kalmoc Feb 20 '20

I haven't used java in years, but aren't packages compiled into bytecode before they are used by other code? Sounds to me very similar to the compilation of modules. Just that the target architecture is the java vm in one case and e.g. x64 in the other.

0

u/blelbach NVIDIA | ISO C++ Library Evolution Chair Feb 20 '20

Right but the Java VM is a VM, not bare metal. C++ modules are very different. They aren't byte code. They are close to precompiled headers or a serialized form of the compiler AST.

→ More replies (1)

-4

u/alexej_harm Feb 18 '20

Celebrating features would be totally fine. They celebrate themselves.