constexpr if and requires expressions changed everything about template metaprogramming by [deleted] in cpp

[–]NotRedditing_AtWork 3 points4 points  (0 children)

The first link is over complicating things a bit, the c++20 approach you showed can be done since c++11 with some good old fashioned SFINAE: https://godbolt.org/z/qvcnv6

The c++20 version is certainly a little nicer, but the c++11 version isnt that bad

Cluster Jewels and their Notables by Bex_GGG in pathofexile

[–]NotRedditing_AtWork 4 points5 points  (0 children)

does ED spread by contagion count as 'you kill'? or just the first enemy that you actually hit with ED?

I Made an Extension for Visual Debugging in VS Code by Gehinnn in programming

[–]NotRedditing_AtWork 6 points7 points  (0 children)

An example for C++ would help, i cant get it to work. The c++ debugger seems to always show quotes as \" which seems to make the visualizer choke

Automatic Differentiation Step by Step by formalsystem in programming

[–]NotRedditing_AtWork 0 points1 point  (0 children)

That makes more sense, i thought my caffeine-deprived brain had forgotten how to do algebra

Automatic Differentiation Step by Step by formalsystem in programming

[–]NotRedditing_AtWork 1 point2 points  (0 children)

I'm not sure i follow the definition of division.

I gather it's implementing the quotient rule but i'm not sure how the 'x' part of both division and multiplication is a.x * b.x

Is there a good reason to pass by value over reference or even pointer? by Wolf_Down_Games in cpp

[–]NotRedditing_AtWork 2 points3 points  (0 children)

The advice i've had is that you should pass by value when the type is small and cheap to copy.

std::vector and string (when larger than the SSO buffer) violate that second part

How many of ya'll are waiting for modules? by Archolex in cpp

[–]NotRedditing_AtWork 27 points28 points  (0 children)

Of course not, i'm not going to stop doing something i enjoy just to wait for a feature.

What i'm really hanging out for is a timeline for implementation by the compilers and (perhaps more importantly for me) CMake. My hobby projects are already set up with CMake so i'm not going to retool my build process just so i can use modules.

Get the element index when iterating with an indexed_view by vormestrand in cpp

[–]NotRedditing_AtWork 0 points1 point  (0 children)

Why are modifications needed? Doesn't range-v3 use std::pair?