#6 no real bug but annoying

closed
nobody
None
1
2005-04-14
2004-12-14
No

hi john,
in win32gui/detail/general/defs.hpp you typedefed
std::basic_string<TCHAR> to string. this can affect
user code:

void func()
{
using namespace win32::gui;
using namespace std;

string str; // could be win32::gui::string or std::
string!
}

i know, developing the library with typing std::string
all the time is very annoying but you could do a final
"Search&Replace in Files" in your vc++ when a new
release is completed so this would only be a
measure of a minute

Discussion

  • Steven Weiss

    Steven Weiss - 2004-12-14
    • priority: 5 --> 1
     
  • John Torjo

    John Torjo - 2005-01-10

    Logged In: YES
    user_id=1031729

    Yes Steve, completely right.

    But guess what, I've done something even better :)
    The wonders of using namespaces:

    namespace definitions {
    typedef TCHAR char_t;
    typedef ::std::basic_string<TCHAR> string;
    }
    using namespace definitions;

    - this will make the char_t/string names visible only
    *within* win32::gui namespace. However, if you say,
    using namespace win32::gui;
    they're not visible.

    Now, hopefully they'll compile with gcc/como as well (tested
    on VC only) :)

    Best,
    John

     
  • Steven Weiss

    Steven Weiss - 2005-01-10

    Logged In: YES
    user_id=1124235

    hehe, great. i didn't think of this possibility :-)

     
  • Steven Weiss

    Steven Weiss - 2005-04-14
    • status: open --> closed
     

Log in to post a comment.