On Wed, Nov 2, 2016 at 8:09 PM, Jim Michaels <[email protected]> wrote:
> namespace str {
> std::string str::localestringlower(std::string s) {
> //not sure if std::locale:: will solve conflicting namespaces
> between <locale> and <string>
> for (size_t i=0; i < s.size(); i++) {
> s[i]=std::tolower(s[i]);
> }
> return s;
> }
> }
> here's another one, compile that and see if it throws error messages about
> declaring a std::string in an arg. it's in a namespace str.
You aren't using the language correctly here. When you do something like this:
namespace str {
// .....
}
Everything inside there implicitly is part of the str namespace. So doing this:
namespace str {
int str::i();
}
is not doing what you think it's doing. That's creating essentially this:
::str::str::i();
So basically, to fix your code snippet, change this:
std::string str::localestringlower(std::string s) {
to:
std::string localestringlower(std::string s) {
Or, define it outside of the namespace str { } block and leave the
namespace qualifier in tact.
I suggest you read up on the syntax of the language, and specifically
how names in C++ are qualified.
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public