Skip to content

Commit

Permalink
Fix inclusion problem with compare
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Reinhard committed Jan 5, 2022
1 parent fb3cc9d commit 0951632
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions include/vikunja/mem/iterator/ConstantIterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,25 @@

#include <iterator>

// check for spaceship support
#if defined __has_include
# if __has_include(<version>)
# include <version>
# endif
# if __has_include(<compare>)
# include <compare>
# if defined(__cpp_lib_three_way_comparison) && defined(__cpp_impl_three_way_comparison)
# define USESPACESHIP
# endif
# endif
#endif

#if __has_cpp_attribute(nodiscard)
# define NODISCARD [[nodiscard]]
#else
# define NODISCARD
#endif

// make sure the compiler supports spaceship
#if defined(__cpp_impl_three_way_comparison)
# include <compare>
#endif

// if the library supports it too, we can use it
#if defined(__cpp_lib_three_way_comparison)
# define USESPACESHIP
#endif

namespace vikunja
{
namespace mem
Expand Down

0 comments on commit 0951632

Please sign in to comment.