Skip to content

Commit

Permalink
Switch to C++20
Browse files Browse the repository at this point in the history
  • Loading branch information
spillerrec committed May 1, 2024
1 parent b1ceebf commit fdade00
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,5 @@ if(MATH_LIBRARY)
endif()

# C++17
set_property(TARGET OvermixCore PROPERTY CXX_STANDARD 17)
set_property(TARGET OvermixCore PROPERTY CXX_STANDARD 20)
set_property(TARGET OvermixCore PROPERTY CXX_STANDARD_REQUIRED ON)
8 changes: 4 additions & 4 deletions src/Geometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ struct Point{
template<typename T2>
Point( const Point<T2>& p ) : x( p.x ), y( p.y ) { }

Point<T>( QPoint p ) : x( p.x() ), y( p.y() ) { }
Point<T>( QPointF p ) : x( p.x() ), y( p.y() ) { }
Point<T>( QSize p ) : x( p.width() ), y( p.height() ) { }
Point<T>( QSizeF p ) : x( p.width() ), y( p.height() ) { }
Point( QPoint p ) : x( p.x() ), y( p.y() ) { }
Point( QPointF p ) : x( p.x() ), y( p.y() ) { }
Point( QSize p ) : x( p.width() ), y( p.height() ) { }
Point( QSizeF p ) : x( p.width() ), y( p.height() ) { }

double lenght() const{ return std::sqrt( x*x + y*y ); }
double manhattanLength() const{ return x+y; }
Expand Down
2 changes: 1 addition & 1 deletion src/planes/ImageEx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class ImageEx{

Point<unsigned> getSize() const{
return std::accumulate( planes.begin(), planes.end(), Point<unsigned>( 0, 0 )
, []( auto& acc, auto& info ){ return acc.max( info.p.getSize() ); } );
, []( const auto& acc, const auto& info ){ return acc.max( info.p.getSize() ); } );
}
unsigned get_width() const{ return getSize().width(); }
unsigned get_height() const{ return getSize().height(); }
Expand Down

0 comments on commit fdade00

Please sign in to comment.