PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.cplus > Boost Compilation
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Boost Compilation

Réponse
 
LinkBack Outils de la discussion
Vieux 22/02/2008, 18h23   #1
Travis
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Boost Compilation

I'm using the compare libraries for the first time (http://
http://www.boost.org/doc/html/string...ng.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.
  Réponse avec citation
Vieux 22/02/2008, 18h39   #2
Victor Bazarov
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Boost Compilation

Travis wrote:
> I'm using the compare libraries for the first time (http://
> http://www.boost.org/doc/html/string...ng.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


  Réponse avec citation
Vieux 22/02/2008, 19h53   #3
Travis
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Boost Compilation

On Feb 22, 10:39 am, "Victor Bazarov" <v.Abaza...@comAcast.net> wrote:
> Travis wrote:
> > I'm using the compare libraries for the first time (http://
> >http://www.boost.org/doc/html/string...r.boost.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.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 12h19.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,15248 seconds with 11 queries