Git Product home page Git Product logo

vitta's People

Contributors

tylerh111 avatar

Watchers

 avatar  avatar

vitta's Issues

Recursive aggregators do not recurse on variadic types

There is an issue where there is no recursive checking of the new types that are added to the aggregation. It occurs in the second recursive case of variant_aggregate_recursive. The NewTs... of the input variant are directly added to the final variant type. These types should be each be recursively checked in case a variant type is one of the NewTs types.

The same is true for the initial call to variant_aggregate_t. If the first argument is a variant, there is no check on its alternatives Ts.... This should be recursively checked before adding any other inputs.

The following is an examples does not compile.

using t1 = int;
using t2 = variant<variant<int>>;

// example of `variant_aggregate` not checking given variant alternatives 
static_assert(is_same_v<
    variant           < t1 >,
    variant_aggregate < t2 >
>);

// example of `variant_aggregate_recursive` not checking new variant alternatives 
static_assert(is_same_v<
    variant           < int, t1 >,
    variant_aggregate < int, t2 >
>);

The same is true for tuple_aggregate and tuple_aggregate_recursive

Feature add generic type trait

There is no difference between variant_aggregate.hpp and tuple_aggregate.hpp aside from variant and tuple. This can be generically represented as a type_trait that takes a variadic type as a template. Something along lines of the following could be possible. Here Agg could be variant or tuple and V is of type Agg.

template < template class<...> Agg, typename V, typename NewTV, typename... NewTVs >
struct aggregate;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.