Boost logo

Boost Users :

From: Alexandre Carsac (acarsac_at_[hidden])
Date: 2001-11-28 11:47:02


>Actually, I believe std::ispunct is a better
implementation than the current one
>that uses "using". Just so I understand, did this
change work? If so, it
>should be suggested as a change to the library.

I don't think so. I think that we must understand what
going on because
the piece of code below works neither with std:: and
namespace (on MSVC6)!

#include<iostream>
#include<boost/tokenizer.hpp>
#include<string>

using namespace std;
using namespace boost;

int main(int, char**){
 
   string s = "c:\\temp\\toto\\|a<x>fdl\\|*.doc";
           //"This| is, a\\| $|test";

  
//////////////////////////////////////////////////////////////////////

   only works with "using namespace std"
   typedef tokenizer<escaped_list_separator<char> >
token_type;
   token_type tok(s, escaped_list_separator<char>('$',
'|', '\"'));

   for(token_type::iterator beg=tok.begin();
beg!=tok.end();++beg){
       cout << *beg << "\n";
   }
   // (the code above is a test and I does not
understand what it does
   // but it does not matter for what we are looking
for!)
  
//////////////////////////////////////////////////////////////////////

  
//////////////////////////////////////////////////////////////////////

   only works with "std:: operator"
   typedef tokenizer<char_delimiters_separator<char> >
token_type;
   token_type tok(s,
char_delimiters_separator<char>(false, 0, "|"));

   for(token_type::iterator beg=tok.begin();
beg!=tok.end();++beg){
       cout << *beg << "\n";
   }
  
//////////////////////////////////////////////////////////////////////

   return 0;
}

>I don't understand what you are trying to do here or
what this has to do with
>regex/tokenizer?

I readed that boost turns _STD:: into std:: with
macro, so I try the same in
 my small test program just trying to see if using
namespace directive inside
a brace's bloc is supported by the MSVC compiler.

Alex

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Courrier : http://courrier.yahoo.fr


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