solution for keyword "uuidof" of g++ ?

Discussion in 'C++' started by William, Jan 19, 2007.

  1. William

    William Guest

    g++(mingw) doesnt support keyword "uuidof" on win32 platform ,
    is there any solution to solve it ?

    thanks !
    William, Jan 19, 2007
    #1
    1. Advertising

  2. William

    Ian Collins Guest

    William wrote:
    >
    > g++(mingw) doesnt support keyword "uuidof" on win32 platform ,
    > is there any solution to solve it ?
    >

    Write your own, it isn't a standard C++ keyword or library function.

    --
    Ian Collins.
    Ian Collins, Jan 19, 2007
    #2
    1. Advertising

  3. William

    Kai-Uwe Bux Guest

    William wrote:

    >
    > g++(mingw) doesnt support keyword "uuidof" on win32 platform ,


    There is no "uuidof" in standard c++.

    > is there any solution to solve it ?


    Since your question concerns something outside the scope of C++ as defined
    by its standard, this news group is the wrong place for your question.
    Maybe folks in a windows group might know.


    Best

    Kai-Uwe Bux
    Kai-Uwe Bux, Jan 19, 2007
    #3
  4. * William:
    >
    > g++(mingw) doesnt support keyword "uuidof" on win32 platform ,
    > is there any solution to solve it ?


    Off the cuff (not tested):

    typedef std::string Uuid; // Whatever, this is just an example.

    template< class T >
    Uuid const& uuidFor()
    {
    return T::uuid(); // General.
    }

    struct A
    {
    static Uuid const& uuid()
    {
    static Uuid id const = "Aha!";
    return id;
    }
    };

    struct B {}; // Might be some existing class.
    Uuid const uuidForB = "Bah!";
    template<> Uuid const& uuidFor<B>() { return uuidForB; }

    int main()
    {
    using namespace std;
    std::cout << uuidFor<A>() << std::endl;
    std::cout << uuidFor<B>() << std::endl;
    }


    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
    Alf P. Steinbach, Jan 19, 2007
    #4
  5. * Kai-Uwe Bux:
    > William wrote:
    >
    >> g++(mingw) doesnt support keyword "uuidof" on win32 platform ,

    >
    > There is no "uuidof" in standard c++.
    >
    >> is there any solution to solve it ?

    >
    > Since your question concerns something outside the scope of C++ as defined
    > by its standard, this news group is the wrong place for your question.
    > Maybe folks in a windows group might know.


    Don't be blinded by the OP's mention of 'win32'.

    UUIDs are used on all common platforms.

    The problem of associating them with classes is a general problem easily
    solved in standard C++, but then whoever invented the language extension
    mentioned by the OP probably didn't find it easy or trivial.

    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
    Alf P. Steinbach, Jan 19, 2007
    #5
  6. William

    red floyd Guest

    Alf P. Steinbach wrote:
    > * Kai-Uwe Bux:
    >> William wrote:
    >>
    >>> g++(mingw) doesnt support keyword "uuidof" on win32 platform ,

    >>
    >> There is no "uuidof" in standard c++.
    >>
    >>> is there any solution to solve it ?

    >>
    >> Since your question concerns something outside the scope of C++ as
    >> defined
    >> by its standard, this news group is the wrong place for your question.
    >> Maybe folks in a windows group might know.

    >
    > Don't be blinded by the OP's mention of 'win32'.
    >
    > UUIDs are used on all common platforms.


    No, we're not blinded by the win32 reference, we're OT'ing his query
    about a Microsoft-specific language extension: namely that classes can
    have an associated UUID, and there's a keyword -- not a function --
    called "uuidof" to get said UUID.
    red floyd, Jan 19, 2007
    #6
  7. William

    William Guest

    it seems that 'wine' (a project to run window program on linux) has a way
    to simulate 'uuidof'.
    i am looking for this.

    On Fri, 19 Jan 2007 11:21:23 +0800, Alf P. Steinbach <>
    wrote:

    > * William:
    >> g++(mingw) doesnt support keyword "uuidof" on win32 platform ,
    >> is there any solution to solve it ?

    >
    > Off the cuff (not tested):
    >
    > typedef std::string Uuid; // Whatever, this is just an example.
    >
    > template< class T >
    > Uuid const& uuidFor()
    > {
    > return T::uuid(); // General.
    > }
    >
    > struct A
    > {
    > static Uuid const& uuid()
    > {
    > static Uuid id const = "Aha!";
    > return id;
    > }
    > };
    >
    > struct B {}; // Might be some existing class.
    > Uuid const uuidForB = "Bah!";
    > template<> Uuid const& uuidFor<B>() { return uuidForB; }
    >
    > int main()
    > {
    > using namespace std;
    > std::cout << uuidFor<A>() << std::endl;
    > std::cout << uuidFor<B>() << std::endl;
    > }
    >
    >
    William, Jan 23, 2007
    #7
  8. William

    red floyd Guest

    William wrote:

    > On Fri, 19 Jan 2007 11:21:23 +0800, Alf P. Steinbach <>
    > wrote:
    >
    >> * William:
    >>> g++(mingw) doesnt support keyword "uuidof" on win32 platform ,
    >>> is there any solution to solve it ?

    >>
    >> Off the cuff (not tested):
    >>
    >> typedef std::string Uuid; // Whatever, this is just an example.
    >>
    >> template< class T >
    >> Uuid const& uuidFor()
    >> {
    >> return T::uuid(); // General.
    >> }
    >>
    >> struct A
    >> {
    >> static Uuid const& uuid()
    >> {
    >> static Uuid id const = "Aha!";
    >> return id;
    >> }
    >> };
    >>
    >> struct B {}; // Might be some existing class.
    >> Uuid const uuidForB = "Bah!";
    >> template<> Uuid const& uuidFor<B>() { return uuidForB; }
    >>
    >> int main()
    >> {
    >> using namespace std;
    >> std::cout << uuidFor<A>() << std::endl;
    >> std::cout << uuidFor<B>() << std::endl;
    >> }

    >
    > it seems that 'wine' (a project to run window program on linux) has a
    > way to simulate 'uuidof'.
    > i am looking for this.


    Top posting redacted. See the FAQ
    http://www.parashift.com/c -faq-lite/how-to-post.html#faq-5.4

    That's still the MSVC compiler doing the uuid_of, and the fact that it's
    compiler specific and NOT in the ISO Standard ISO/IEC 14882 makes it OT.

    See http://www.parashift.com/c -faq-lite/how-to-post.html#faq-5.9 for a
    list of suggested newsgroups. In particular, since your question is
    about g++, may I suggest gnu.g++.help?
    red floyd, Jan 23, 2007
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Francis
    Replies:
    0
    Views:
    420
    Andrew Francis
    Jun 28, 2006
  2. =?Utf-8?B?Y2FzaGRlc2ttYWM=?=

    Solution file not in the solution folder

    =?Utf-8?B?Y2FzaGRlc2ttYWM=?=, Sep 12, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    1,109
    Laurent Bugnion
    Sep 12, 2006
  3. Replies:
    6
    Views:
    454
    Peter Otten
    May 10, 2007
  4. Hamilton, William

    RE: keyword checker - keyword.kwlist

    Hamilton, William, May 10, 2007, in forum: Python
    Replies:
    4
    Views:
    351
  5. , India
    Replies:
    17
    Views:
    1,057
    James Kanze
    Oct 1, 2007
Loading...

Share This Page