<commit_before>/**
 * @file
 *
 * @brief An implementation or an importation of a @ref cuda::optional class and related definitions.
 *
 */
#ifndef CUDA_API_WRAPPERS_OPTIONAL_HPP
#define CUDA_API_WRAPPERS_OPTIONAL_HPP

#if __cplusplus >= 201703L
#include <optional>
#include <any>
namespace cuda {
using ::std::optional;
using ::std::nullopt;
} // namespace cuda
#elif __cplusplus >= 201402L
namespace cuda {
#include <experimental/optional>
#include <experimental/any>
using ::std::experimental::optional;
using ::std::experimental::nullopt;
} // namespace cuda
#else

#include <type_traits>
#include <utility>

namespace cuda {

namespace detail_ {

struct no_value_t { };

template<typename T>
struct poor_mans_optional {
	static_assert(::std::is_trivially_destructible<T>::value, "Use a simpler type");
	union maybe_value_union_t {
		no_value_t no_value;
		T value;
	};

	poor_mans_optional &operator=(const poor_mans_optional &other) = default;

	poor_mans_optional &operator=(poor_mans_optional &&other) = default;<commit_msg>Fixes #416: Moved experimental optional and any inclusions out of `namespace cuda`<commit_after>/**
 * @file
 *
 * @brief An implementation or an importation of a @ref cuda::optional class and related definitions.
 *
 */
#ifndef CUDA_API_WRAPPERS_OPTIONAL_HPP
#define CUDA_API_WRAPPERS_OPTIONAL_HPP

#if __cplusplus >= 201703L
#include <optional>
#include <any>
namespace cuda {
using ::std::optional;
using ::std::nullopt;
} // namespace cuda
#elif __cplusplus >= 201402L
#include <experimental/optional>
#include <experimental/any>
namespace cuda {
using ::std::experimental::optional;
using ::std::experimental::nullopt;
} // namespace cuda
#else

#include <type_traits>
#include <utility>

namespace cuda {

namespace detail_ {

struct no_value_t { };

template<typename T>
struct poor_mans_optional {
	static_assert(::std::is_trivially_destructible<T>::value, "Use a simpler type");
	union maybe_value_union_t {
		no_value_t no_value;
		T value;
	};

	poor_mans_optional &operator=(const poor_mans_optional &other) = default;

	poor_mans_optional &operator=(poor_mans_optional &&other) = default;
{'fraction_non_alphanumeric': 0.11533052039381153, 'fraction_numerical': 0.012658227848101266, 'mean_word_length': 6.461538461538462, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5264877', 'n_tokens_mistral': 756, 'n_tokens_neox': 697, 'n_words': 180}