Skip to content

Conversation

@MoonPadUSer
Copy link
Contributor

This PR removes the custom implementation of min() and max() and replaces it with std::min() and std::max()

@robalni
Copy link
Contributor

robalni commented Aug 2, 2020

Why was this done? What is the reason to use min and max from std?

@MoonPadUSer
Copy link
Contributor Author

yes, we wanna get rid of most custom written functions and types and switch to using their standard alternatives. that way we might be able to get rid of geom.h and tools.h some day

@MoonPadUSer MoonPadUSer requested a review from TheAssassin August 2, 2020 15:50
@robalni
Copy link
Contributor

robalni commented Aug 2, 2020

Why do we not want to have geom.h and tools.h?

@TheAssassin
Copy link
Member

TheAssassin commented Aug 2, 2020

Many of the things written in tools.h behave in strange ways, hide memory problems or behave unexpectedly otherwise. Also, they're redundant to the STL. And they lack the necessary interface so you cannot use STL algorithms with them. They don't support modern C++ features like e.g., rvalue references. There is no point in having implemented everything by yourself. The STL is well tested and known to work, also most C++ developers know how to use it.

Also, most headers with these custom template classes are e.g., included more than once, among with other weirdnesses. I've never seen code have to include headers more than once without having header guards or #pragma once the way it's done here.

@voidanix
Copy link
Member

voidanix commented Jul 9, 2022

@MoonPadUSer can you please rebase and squash both this and #189?

@voidanix voidanix force-pushed the use-std-min-and-max branch from 179fd05 to f8188c0 Compare April 29, 2023 11:01
@voidanix voidanix force-pushed the use-std-min-and-max branch from f8188c0 to 5a12104 Compare December 6, 2025 23:58
@TheAssassin TheAssassin added this to the 1.7.0 milestone Dec 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants