473,395 Members | 1,653 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

solution for keyword "uuidof" of g++ ?


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

thanks !
Jan 19 '07 #1
7 4634
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.
Jan 19 '07 #2
* 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?
Jan 19 '07 #3
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
Jan 19 '07 #4
* 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?
Jan 19 '07 #5
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.
Jan 19 '07 #6

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 <al***@start.no
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;
}

Jan 23 '07 #7
William wrote:
On Fri, 19 Jan 2007 11:21:23 +0800, Alf P. Steinbach <al***@start.no>
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-lit...t.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-lit...t.html#faq-5.9 for a
list of suggested newsgroups. In particular, since your question is
about g++, may I suggest gnu.g++.help?
Jan 23 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

47
by: Andrey Tatarinov | last post by:
Hi. It would be great to be able to reverse usage/definition parts in haskell-way with "where" keyword. Since Python 3 would miss lambda, that would be extremly useful for creating readable...
59
by: seberino | last post by:
I've heard 2 people complain that word 'global' is confusing. Perhaps 'modulescope' or 'module' would be better? Am I the first peope to have thought of this and suggested it? Is this a...
18
by: tweak | last post by:
What's the best way to use extern when using multiplefiles that is easiest to maintain? Is it best to declare: extern int a; in a header file and include the header file in all files except...
3
by: JM | last post by:
Hi I created a small app in Visual C# Express Beta 1. I now want to port it back to Visual C# 2003. Is that possible? I'm have a heck of a time!
41
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
6
by: issac | last post by:
Hi folks Im trying to do a simple query involving the distinct keyword and an access 2000 db, but have been frittering with it for amost and hour and a half and I cant make it work. This is...
33
by: Snis Pilbor | last post by:
With the "as if" rule in play, doesn't that effectively render the "register" keyword completely useless? Example: I make a silly compiler which creates code that goes out of its way to take a...
4
by: geetha | last post by:
Dear all, I have a database with all the research capabilities of professors of a university. I need to implement a "keyword search" feature in my welcome page which will actually work like a...
4
by: KleberUK | last post by:
Good afternoon, I've been batling with this for a very long time. I would like to be able to use the Me keyword in a module. I spent hours and days trying to find a solution for this. There might...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.