Boost Compilation

T

Travis

I'm using the compare libraries for the first time (http://
www.boost.org/doc/html/string_algo/reference.html#header.boost.algorithm.string.compare.hpp).
I guess I'm not including the right thing because I can't get certain
functions to work.

This works....

#include <iomanip>
#include <iostream>
#include <string>

#include <boost/algorithm/string/compare.hpp>

using namespace std;
using namespace boost;

boost::is_equal IsEqual;

int main()
{
// inital output
string First;
string Second;

cout << "String 1: ";
cin >> First;
cout << "String 2: ";
cin >> Second;

string IsEqualResult = IsEqual(First,Second) ? "yes" : "no";

cout << "IsEqual = " << IsEqualResult << endl;

return 0;
}

But changing it to use boost::is_iequal, boost::is_less, etc. doesn't
seem to compile. I'm not sure what I'm missing from the documentation,
I think I'm including everything necessary.
 
V

Victor Bazarov

Travis said:
I'm using the compare libraries for the first time (http://
www.boost.org/doc/html/string_algo/reference.html#header.boost.algorithm.string.compare.hpp).
I guess I'm not including the right thing because I can't get certain
functions to work.

This works....

#include <iomanip>
#include <iostream>
#include <string>

#include <boost/algorithm/string/compare.hpp>

using namespace std;
using namespace boost;

boost::is_equal IsEqual;

int main()
{
// inital output
string First;
string Second;

cout << "String 1: ";
cin >> First;
cout << "String 2: ";
cin >> Second;

string IsEqualResult = IsEqual(First,Second) ? "yes" : "no";

cout << "IsEqual = " << IsEqualResult << endl;

return 0;
}

But changing it to use boost::is_iequal, boost::is_less, etc. doesn't
seem to compile.

"Doesn't seem"? Are you unsure? What "seems" to be the problem?
What messages do you get from your compiler? Why do I have to pull
it out of you?

BTW, do you know of the existence of Boost online forums? They are
right there, on their web site...
I'm not sure what I'm missing from the documentation,
I think I'm including everything necessary.

V
 
T

Travis

"Doesn't seem"? Are you unsure? What "seems" to be the problem?
What messages do you get from your compiler? Why do I have to pull
it out of you?

BTW, do you know of the existence of Boost online forums? They are
right there, on their web site...


V

Thanks for the info. I won't bother clarifying the "seems". I'll move
the topic to a more useful forum. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top