Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > solution for keyword "uuidof" of g++ ?

Reply
Thread Tools

solution for keyword "uuidof" of g++ ?

 
 
William
Guest
Posts: n/a
 
      01-19-2007

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

thanks !
 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      01-19-2007
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.
 
Reply With Quote
 
 
 
 
Kai-Uwe Bux
Guest
Posts: n/a
 
      01-19-2007
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
 
Reply With Quote
 
Alf P. Steinbach
Guest
Posts: n/a
 
      01-19-2007
* 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?
 
Reply With Quote
 
Alf P. Steinbach
Guest
Posts: n/a
 
      01-19-2007
* 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?
 
Reply With Quote
 
red floyd
Guest
Posts: n/a
 
      01-19-2007
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.


 
Reply With Quote
 
William
Guest
Posts: n/a
 
      01-23-2007

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 <(E-Mail Removed)>
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;
> }
>
>


 
Reply With Quote
 
red floyd
Guest
Posts: n/a
 
      01-23-2007
William wrote:

> On Fri, 19 Jan 2007 11:21:23 +0800, Alf P. Steinbach <(E-Mail Removed)>
> 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?


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: keyword checker - keyword.kwlist Hamilton, William Python 4 05-13-2007 06:31 AM
keyword checker - keyword.kwlist tom@finland.com Python 6 05-10-2007 04:53 PM
A Solution using Tasks Re: [Stackless] Suggestion for a Solution ? Andrew Francis Python 0 06-28-2006 06:05 PM



Advertisments