Questions tagged [boost-tuples]

A Boost C++ library providing an implementation of tuple, a fixed-sized collection of elements, possibly of different types

54 questions
1
vote
1 answer

Error in template function (using Boost.Tuples)

#include #include template void f(InputIterator it) { typedef boost::tuple Pair; std::list paired; typename…
Zachary Vance
  • 752
  • 4
  • 18
1
vote
2 answers

c++11 combining std::tuple and std::tie for efficient ordering

I am fairly new to std::tuple and std::tie. I need a way to efficiently order structs according to a left to right ordering of comparisons. For this reason, I chose to use the std::make_tuple and std::tie types for custom ordering a StructA in the…
johnco3
  • 2,401
  • 4
  • 35
  • 67
1
vote
1 answer

c++11 tie name clash with boost

I am trying to migrate some code from boost::tuple to std::tuple but I'm getting some weird errors: after I invoke using namespace std (and never boost), I expect an unqualified tie to resolve to std::tie. However, this seems to fail when the tuple…
Matei David
  • 2,322
  • 3
  • 23
  • 36
1
vote
1 answer

Is boost tuple mutable?

I have been using a using a boost tuple as the value in an STL map. Up until now, I only had to construct the tuple and insert into the map and at a later stage retrieve the values. Now I need to be able to change the tuple in the map. Is this…
Pradyot
  • 2,897
  • 7
  • 41
  • 58
1
vote
1 answer

Getting tuple element by type (pre C++0x)

I have a templated class that holds a tuple and want to be able to retrieve the elements by type at compile time. To simplify things the container class is restricted to a maximum of three entries: template< class U = null_type, class V = null_type,…
1
vote
1 answer

Fusion vector projection

I have a fusion vector with elements which have several member data of different types and I would like to create a new fusion vector(s) that will project just specific data member(s). I've been looking into this for some time already but no…
G. Civardi
  • 667
  • 5
  • 12
1
vote
2 answers

Boost::tuple - assigning to get<>()

The following fails to compile on the assignment to t.get<1>(). struct pull_from_memory { pull_from_memory(MemoryBank &m) : m_map(m) {}; void operator()(boost::tuple &t ) { MemoryBank::iterator i; if ( ( i…
Chap
  • 3,649
  • 2
  • 46
  • 84
1
vote
0 answers

Streaming strings into a boost::fusion::vector doesn't work?

I'd like to initialize a fusion::vector by streaming from std::cin. It seems this isn't possible as the documentation says: ...extracting Sequence(s) with std::string or C-style string elements does not generally work, since the streamed Sequence…
hhbilly
  • 1,265
  • 10
  • 18
1
vote
1 answer

boost error: reference to 'detail' is ambiguous

I'm compiling a large program with gcc-4.4.7 --std=c++0x and several libraries from boost-1.53. The compiler is complaining about a bunch of errors in the boost libraries (below), but not about my code. Is this a bug in boost libraries? How would…
theTrickster
  • 99
  • 1
  • 8
1
vote
2 answers

with tuples and boost.fusion, is there any reason to use struct?

tuples are similar to structs (discussed here: Boost::Tuples vs Structs for return values). it seems that the only advantage is it's more convenient to write struct because it's shorter and by key rather than a number. one can also use fusion map…
kirill_igum
  • 3,953
  • 5
  • 47
  • 73
1
vote
1 answer

Search a vector of boost::tuple

Is there an algorithm or helper method in the boost library to search a vector of boost::tuple objects? Here is my code: typedef boost::tuple Tuple; typedef std::vector ErrorStringMap; ErrorStringMap mystrings…
void.pointer
  • 24,859
  • 31
  • 132
  • 243
0
votes
1 answer

Boost tuple, linker error on Mac OS X 10.7

I have compiled boost 1.49.0 from source on a MacBook Pro running Mac OS X 10.7.3, I use Xcode 4.3.2 and Apple's LLVM 3.1 as my development environment. The following line of code (from boost http server1 example) results in a linking error as…
0
votes
2 answers

Boost Spirit Auto Parser fails for a tuple of doubles

At the following code I am trying to use Boost Spirit Auto Parser for a sequence or two doubles, but it doesn't compile. What am I doing wrong here? // file main.cpp #include #include namespace…
Vahagn
  • 4,670
  • 9
  • 43
  • 72
0
votes
1 answer

Template function parameter incomplete type c++

I have a template function that I implement by passing as parameter another function cb. Then I get the types of the arguments that I pass as parameters to the cb function. template websockets::handle start_subscription (std::string…
0
votes
1 answer

reference to element in boost.fusion vector

EDIT - please ignore - the question resolved around a simple typo. I need a break. How do I access a reference to an element of a boost fusion vector? Unlike boost.tuples's tuples::get(variable) (returns a reference), the…
Tom
  • 5,219
  • 2
  • 29
  • 45