Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
sabudilovskiy committed Oct 2, 2024
1 parent 0bf7919 commit b4fd091
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/CI_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ jobs:
- type: Debug
compiler: gcc
cxx_compiler: g++
version: 11

version: 11
- type: Debug
compiler: gcc
cxx_compiler: g++
version: 14
version: 12

name: '${{matrix.type}} ${{matrix.compiler}}-${{matrix.version}}'
runs-on: ubuntu-22.04 #bug in std library(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115119)
Expand Down
12 changes: 5 additions & 7 deletions include/tgbm/api/optional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,8 @@ struct optional<Integer> {
using value_type = Integer;

private:
static consteval Integer empty() {
return Integer(std::numeric_limits<int64_t>::max());
}
Integer _val = empty();
static constexpr Integer empty_ = std::numeric_limits<int64_t>::max();
Integer _val = empty_;

public:
constexpr optional() noexcept = default;
Expand All @@ -303,21 +301,21 @@ struct optional<Integer> {
constexpr optional(std::nullopt_t) noexcept : optional() {
}
constexpr optional& operator=(std::nullopt_t) noexcept {
_val = empty();
_val = empty_;
return *this;
}
constexpr optional& operator=(value_type b) noexcept {
_val = b;
return *this;
}
constexpr bool has_value() const noexcept {
return _val != empty();
return _val != empty_;
}
constexpr explicit operator bool() const noexcept {
return has_value();
}
constexpr void reset() noexcept {
_val = empty();
_val = empty_;
}
constexpr value_type& emplace(value_type v = value_type{}) noexcept {
return _val = v;
Expand Down

0 comments on commit b4fd091

Please sign in to comment.