taocpp / tuple Goto Github PK
View Code? Open in Web Editor NEWCompile-time-efficient proof-of-concept implementation for std::tuple
License: MIT License
Compile-time-efficient proof-of-concept implementation for std::tuple
License: MIT License
Hey!
I am integrating tao::tuple in an existing std::tuple code base. Problem that I run into is that this particular code base is using Structured Bindings very heavily to get access to the tuple members.
tao::tuple as of now has no support for it. I was looking to add support for that, but I am struggling a bit. And perhaps some of the maintainers can give some assistance.
I fear that since tao::tuple is inheritence based, support will be impossible. But perhaps there is a way I do not see?
When trying to create a structured bindng for a tao::tuple, like this:
const auto tuple = tao::make_tuple(1, 2); const auto [v1, v2] = tuple;
I get the following error:
the number of identifiers must match the number of array elements or members in a structured binding declaration
Since tao::tuple decomposes into a single type: tuple_base.
Any help is greatly appreciated.
Currently does not compile with GCC 7.3.1 and the -std=c++17 flag. All test cases throw 'wrong number of template arguments' errors.
Hi, I got this very simple Taocpp code:
#include <iostream>
#include <tao/tuple/tuple.hpp>
int main(int argc, char* argv[]) {
auto t2 = tao::tuple< int, double, int >( 1, 2, 3 );
tao::get< 0 >( t2 ) = 0;
tao::get< 1 >( t2 ) = 2;
tao::get< 2 >( t2 ) = 3;
}
with the dependency: https://github.com/taocpp/tuple.git cloned to ./_deps/taotuple-src. Then I compile it with nvcc 11.4.48 and g++ 9.3.0 by
nvcc -ccbin g++-9 -I_deps/taotuple-src/include -x cu testTuple.cpp -o testTuple
and get this compilation error:
testTuple.cpp(19): error: no instance of overloaded function "tao::get" matches the argument list
argument types are: (tao::tuple<int, double, int>)
testTuple.cpp(20): error: no instance of overloaded function "tao::get" matches the argument list
argument types are: (tao::tuple<int, double, int>)
testTuple.cpp(21): error: no instance of overloaded function "tao::get" matches the argument list
argument types are: (tao::tuple<int, double, int>)
I am using a5f3b87 on the main branch.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.