Pagghiu / SaneCppLibraries

Sane C++ Libraries
https://pagghiu.github.io/SaneCppLibraries
MIT License
521 stars 12 forks source link

Algorithm: Added Min / Max algorithm #13

Closed Carlos4621 closed 9 months ago

Carlos4621 commented 9 months ago

I have added the Min/Max algorithms, as suggested by the library changes

Carlos4621 commented 9 months ago

You could add the minmax algorithm but I didn't find something similar to std::pair in the library

Pagghiu commented 9 months ago

Hi @Carlos4621, thanks for your MR.

The min / max are a little special as they're widely used also in the containers library, so I've been putting them in the Compiler.h that is included almost everywhere.

https://github.com/Pagghiu/SaneCppLibraries/blob/2160a852d23d62a5e8c9677bb8297bba3f3d97f6/Libraries/Foundation/Compiler.h#L278

But now that I look at them they're not const T& as they should be, so maybe you could repurpose your MR to fix them.

A few notes:

Carlos4621 commented 9 months ago

Sorry for the confusion, I'm new to contributing projects. Thanks for the recommendations you gave me.