Skip to content

Commit

Permalink
Merge pull request #9548
Browse files Browse the repository at this point in the history
c1ead13 wallet2_api: use std::optional instead of handmade optional (jeffro256)
  • Loading branch information
luigi1111 committed Dec 23, 2024
2 parents 6633fcb + c1ead13 commit 318bc17
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions src/wallet/api/wallet2_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@
#pragma once


#include <string>
#include <vector>
#include <list>
#include <set>
#include <cstdint>
#include <ctime>
#include <iostream>
#include <list>
#include <optional>
#include <set>
#include <stdexcept>
#include <cstdint>
#include <string>
#include <vector>

// Public interface for libwallet library
namespace Monero {
Expand All @@ -54,18 +55,9 @@ enum NetworkType : uint8_t {
void onStartup();
}

// backwards compatible shim for old declaration of handmade optional<> struct
template<typename T>
class optional {
public:
optional(): set(false) {}
optional(const T &t): t(t), set(true) {}
const T &operator*() const { return t; }
T &operator*() { return t; }
operator bool() const { return set; }
private:
T t;
bool set;
};
using optional = std::optional<T>;

/**
* @brief Transaction-like interface for sending money
Expand Down

0 comments on commit 318bc17

Please sign in to comment.