#include "boost/tuple/tuple.hpp"
#include "boost/core/lightweight_test.hpp"
#include <string>
#include <utility>
using namespace boost;
using namespace boost::tuples;
template<class T> void dummy(const T&) {}
class A {}; class B {}; class C {};
class no_copy {
no_copy(const no_copy&) {}
public:
no_copy() {};
};
no_copy y;
#ifdef E1
tuple<no_copy> v1; #endif
#ifdef E2
char cs[10];
tuple<char[10]> v3; #endif
class no_def_constructor {
no_def_constructor() {}
public:
no_def_constructor(std::string) {} };
void foo1() {
#ifdef E3
dummy(tuple<no_def_constructor, no_def_constructor, no_def_constructor>());
#endif
}
void foo2() {
#ifdef E4
dummy(tuple<double&>()); dummy(tuple<const double&>()); #endif
#ifdef E5
double dd = 5;
dummy(tuple<double&>(dd+3.14)); #endif
}
void foo3() {
#ifdef E7
std::make_pair("Doesn't","Work"); #endif
}
void foo4()
{
double d = 2.7;
A a;
tuple<int, double&, const A&> t(1, d, a);
const tuple<int, double&, const A> ct = t;
(void)ct;
#ifdef E8
get<0>(ct) = 5; #endif
#ifdef E9
get<4>(t) = A(); #endif
#ifdef E10
dummy(get<5>(ct)); #endif
}
class AA {};
class BB : public AA {};
struct CC { CC() {} CC(const BB& b) {} };
struct DD { operator CC() const { return CC(); }; };
void foo5() {
tuple<char, BB*, BB, DD> t;
(void)t;
tuple<char, char> aaa;
tuple<int, int> bbb(aaa);
(void)bbb;
}
void foo7() {
tuple<int, int, float> a;
#ifdef E11
a = std::make_pair(1, 2); #endif
dummy(a);
}
int main() {
foo1();
foo2();
foo3();
foo4();
foo5();
foo7();
return boost::report_errors();
}