[edit2]
Since the answers in the above questions did not help me solve my problem fully, I would like to add this:
When using clang from Homebrew -stdlib=libc++
did not work for me. I't could not be found from Hombrew clang. My solution was to build libc++ according to instructions on their web page. And then use clang++ -I/path/to/libcxx/include -L/path/to/libcxx/lib
after exporting DYLD_LIBRARY_PATH
, also from instructions on libc++ web page.
[/edit2]
[edit]
Looking at the first few comments I see I have an error. But string::const_iterator gives the same error.
error: no member named 'cbegin' in
'std::basic_string<char>'
for ( string::const_iterator it = line.cbegin();
[/edit]
I am trying to compile the folowing code using -std=c++11. I am using clang 3.2 via homebrew and I am getting the error in the title.
vector<string> extractWords( const string& line ) {
string tmp;
vector<string> words;
int colonCount = 0;
for ( string::iterator it = line.cbegin();
it != line.end(); ++it ) {
if ( isprint( *it ) && !isspace( *it ) ) {
}
}
...
return words;
}
Shouldn't this work with c++11?
(sorry about the accidental deletion of the post)