Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Boost Compilation

Reply
Thread Tools

Boost Compilation

 
 
Travis
Guest
Posts: n/a
 
      02-22-2008
I'm using the compare libraries for the first time (http://
http://www.boost.org/doc/html/string...g.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.
 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      02-22-2008
Travis wrote:
> I'm using the compare libraries for the first time (http://
> http://www.boost.org/doc/html/string...g.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
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


 
Reply With Quote
 
 
 
 
Travis
Guest
Posts: n/a
 
      02-22-2008
On Feb 22, 10:39 am, "Victor Bazarov" <(E-Mail Removed)> wrote:
> Travis wrote:
> > I'm using the compare libraries for the first time (http://
> >http://www.boost.org/doc/html/string...ost.algori...).
> > 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
> --
> Please remove capital 'A's when replying by e-mail
> I do not respond to top-posted replies, please don't ask


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

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Boost::any and boost::lambda with std::find_if Misiu C++ 3 01-31-2007 05:46 PM
#include <boost/shared_ptr.hpp> or #include "boost/shared_ptr.hpp"? Colin Caughie C++ 1 08-29-2006 02:19 PM
Problems mixing boost::lambda::bind and boost::shared_ptr.. Toby Bradshaw C++ 6 06-02-2006 04:12 PM
Any Boost Experts out there for Boost.Regex? Richard Latter C++ 2 05-17-2004 03:12 PM
Boost + Python C/API: Mixing python return types with boost return types Steve Knight Python 2 10-10-2003 10:11 AM



Advertisments