<commit_before>Variant
===

Boost provides
[`boost::variant`](http://www.boost.org/doc/libs/1_53_0/doc/html/variant.html)
to provide a type-checked discriminated union type.

This library provides a simple `variant` type similar in concept to
`boost::variant`, that works in CUDA, for use in GPU code.

This type is not as fully featured as `boost::variant`.  It does not
support recursive variants, nor does it support variants of references.

`variant`s are accessed by means of `static_visitor` classes that
overload `operator()` for all types in the variant, and then are
applied using `apply_visitor()`, as shown in the example.  Compile-time
errors result from trying to visit `variant`s with `static_visitor`s
that do not provide overloads for all types in the `variant`. This is
an important safety benefit.

We do not currently support a `get<T>()` method to explicitly extract a
type from the variant, since CUDA does not currently support
exceptions, which are necessary for the case when the object held by
the variant is not of type `T` as requested by `get<T>()`.

This variant is limited to 10 types.

Usage
===
```c++
#include <variant/variant.h>
#include <iostream>
#include <thrust/copy.h>
#include <thrust/device_vector.h>

//Non-pod type
struct foo{
    int o;
    __host__ __device__
    foo(int _o) : o(_o) {};
};

typedef variant::variant<int, foo> my_variant;

struct my_visitor : public variant::static_visitor<int> {
    __host__ __device__<commit_msg>Add note about tested platforms.<commit_after>Variant
===

Boost provides
[`boost::variant`](http://www.boost.org/doc/libs/1_53_0/doc/html/variant.html)
to provide a type-checked discriminated union type.

This library provides a simple `variant` type similar in concept to
`boost::variant`, that works in CUDA, for use in GPU code.

This type is not as fully featured as `boost::variant`.  It does not
support recursive variants, nor does it support variants of references.

`variant`s are accessed by means of `static_visitor` classes that
overload `operator()` for all types in the variant, and then are
applied using `apply_visitor()`, as shown in the example.  Compile-time
errors result from trying to visit `variant`s with `static_visitor`s
that do not provide overloads for all types in the `variant`. This is
an important safety benefit.

We do not currently support a `get<T>()` method to explicitly extract a
type from the variant, since CUDA does not currently support
exceptions, which are necessary for the case when the object held by
the variant is not of type `T` as requested by `get<T>()`.

This variant is limited to 10 types.

This code has been tested on Linux and Mac OS X, with nvcc 5.0 and g++ 4.6.

Usage
===
```c++
#include <variant/variant.h>
#include <iostream>
#include <thrust/copy.h>
#include <thrust/device_vector.h>

//Non-pod type
struct foo{
    int o;
    __host__ __device__
    foo(int _o) : o(_o) {};
};

typedef variant::variant<int, foo> my_variant;

struct my_visitor : public variant::static_visitor<int> {
    __host__ __device__
{'fraction_non_alphanumeric': 0.09338138925294888, 'fraction_numerical': 0.005242463958060288, 'mean_word_length': 4.643253234750462, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1234733', 'n_tokens_mistral': 928, 'n_tokens_neox': 893, 'n_words': 404}