|
Boost Users : |
From: agiatojon
Date: 2003-01-01 10:09:45
Happy Holidays to everyone! I am getting aquainted with the tuple
class but am encountering the following error:
c:\BGL\boost_1_29_0\boost\tuple\tuple_comparison.hpp(119): error
C2027: use of undefined type 'boost::STATIC_ASSERTION_FAILURE<x>'
with
[
x=false
]
with the following program:
/**
* tupleTest.cpp
* Test of Boost library class tuple
* A tuple is a fixed size collection of elements
* Stored objects may be of different types
* Current support of tuples with 0-10 objects
* Objects may be any valid C++ type except void and function types
* Jon Agiato
* 12-23-02
*/
#include <iostream>
using std::cout;
using std::cin;
using std::ostream;
using std::cerr;
#include <cstdlib>
#include <boost/tuple/tuple.hpp>
using boost::tuple;
// both tuple_io.hpp and tuple_comparison.hpp include tuple.hpp
// tuple_io must be included for tuple input and output operators
#include <boost/tuple/tuple_io.hpp>
// tuple_comparison.hpp must be included for comparison operators
#include <boost/tuple/tuple_comparison.hpp>
#include <string>
using std::string;
#include <exception>
using std::exception;
class A
{
friend ostream &operator<<(ostream &output, const A &a)
{
output << a.S;
return output;
}
public:
A(string s = "Testing"):S(s) {;}
string S;
};
class B
{
friend ostream &operator<<(ostream &output, const B &b)
{
output << b.D;
return output;
}
public:
B(double d = 3.501):D(d) {;}
double D;
};
class C
{
friend ostream &operator<<(ostream &output, const C &c)
{
output << c.state;
return output;
}
public:
C(bool st = true):state(st) {;}
double state;
};
int main()
{
try
{
tuple<A, B, C> testTuple;
cout << testTuple << '\n';
tuple<B, A> test2Tuple;
if(testTuple == test2Tuple)
cout << testTuple << " is equal to " << test2Tuple << '\n';
else
cout << testTuple << " is not equal to " << test2Tuple
<< '\n';
cout << "Press enter to exit...";
cin.get();
return EXIT_SUCCESS;
}
catch(const exception &E)
{
cerr << "Standard library exception: " << E.what() << '\n';
return EXIT_FAILURE;
}
catch(...)
{
cerr << "Unknown exception thrown.\n";
return EXIT_FAILURE;
}
}
I am using Visual Studio.NET Enterprise Architect
Thanks!
Jon Agiato
JonAgiato_at_[hidden]
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net