chromium/third_party/zxcvbn-cpp/native-src/zxcvbn/optional.hpp

/* A lightweight version of C++1y optional */

#ifndef __ZXCVBN__OPTIONAL_HPP
#define __ZXCVBN__OPTIONAL_HPP

#include <functional>
#include <new>
#include <stdexcept>
#include <type_traits>
#include <utility>

#include <cstdint>
#include <cassert>

namespace zxcvbn {

namespace optional {

class nullopt_t {};

constexpr nullopt_t nullopt;

class bad_optional_access : public std::logic_error {};

template <class T>
class optional {};

template <class T>
constexpr bool operator==(optional<T> f, nullopt_t) {}

template <class T>
constexpr bool operator!=(optional<T> f, nullopt_t n) {}

template <class T>
constexpr bool operator==(nullopt_t, optional<T> f) {}

template <class T>
constexpr bool operator!=(nullopt_t n, optional<T> f) {}

template <class T>
constexpr bool operator==(optional<T> a, optional<T> b) {}

template <class T>
constexpr bool operator!=(optional<T> a, optional<T> b) {}

template <class T>
constexpr optional<typename std::decay<T>::type> make_optional(T &&value) {}

}

}

namespace std {

hash<zxcvbn::optional::optional<T>>;

}

#endif