[nostalgia/geo] GCC 12 fix

This commit is contained in:
Gary Talent 2022-05-25 21:18:05 -05:00
parent 729cde5bf9
commit a9d5272176
3 changed files with 5 additions and 4 deletions

View File

@ -32,7 +32,7 @@ struct Vec {
T y = 0; T y = 0;
template<typename RefType = value_type&, typename PtrType = value_type*, bool reverse = false> template<typename RefType = value_type&, typename PtrType = value_type*, bool reverse = false>
struct iterator: public std::iterator<std::bidirectional_iterator_tag, value_type> { struct iterator: public ox::Iterator<std::bidirectional_iterator_tag, value_type> {
private: private:
PtrType m_t = nullptr; PtrType m_t = nullptr;
size_type m_offset = 0; size_type m_offset = 0;
@ -60,7 +60,7 @@ struct Vec {
} }
} }
constexpr typename std::iterator<std::bidirectional_iterator_tag, value_type>::difference_type constexpr typename ox::Iterator<std::bidirectional_iterator_tag, value_type>::difference_type
operator-(const iterator &other) const noexcept { operator-(const iterator &other) const noexcept {
if constexpr(reverse) { if constexpr(reverse) {
return m_offset + other.m_offset; return m_offset + other.m_offset;

View File

@ -2,6 +2,7 @@
* Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved. * Copyright 2016 - 2022 Gary Talent (gary@drinkingtea.net). All rights reserved.
*/ */
#include <algorithm>
#include <filesystem> #include <filesystem>
#include <ox/std/std.hpp> #include <ox/std/std.hpp>

View File

@ -27,8 +27,8 @@ enum class ProjectEvent {
}; };
[[nodiscard]] [[nodiscard]]
constexpr ox::Result<ox::String> fileExt(auto path) noexcept { constexpr ox::Result<ox::String> fileExt(const ox::String &path) noexcept {
const auto extStart = std::find(path.crbegin(), path.crend(), '.').offset(); const auto extStart = ox::find(path.crbegin(), path.crend(), '.').offset();
if (!extStart) { if (!extStart) {
return OxError(1, "Cannot open a file without valid extension."); return OxError(1, "Cannot open a file without valid extension.");
} }