solution for keyword "uuidof" of g++ ?

W

William

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

thanks !
 
I

Ian Collins

William said:
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.
 
K

Kai-Uwe Bux

William said:
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
 
A

Alf P. Steinbach

* 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

Alf P. Steinbach

* Kai-Uwe Bux:
There is no "uuidof" in standard c++.


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.
 
R

red floyd

Alf said:
* Kai-Uwe Bux:

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.
 
W

William

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

red floyd

William said:
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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top