Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   solution for keyword "uuidof" of g++ ? (http://www.velocityreviews.com/forums/t459916-solution-for-keyword-uuidof-of-g.html)

William 01-19-2007 02:54 AM

solution for keyword "uuidof" of g++ ?
 

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

thanks !

Ian Collins 01-19-2007 03:01 AM

Re: solution for keyword "uuidof" of g++ ?
 
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.

Kai-Uwe Bux 01-19-2007 03:19 AM

Re: solution for keyword "uuidof" of g++ ?
 
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

Alf P. Steinbach 01-19-2007 03:21 AM

Re: solution for keyword "uuidof" of g++ ?
 
* 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 01-19-2007 03:48 AM

Re: solution for keyword "uuidof" of g++ ?
 
* 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?

red floyd 01-19-2007 06:18 AM

Re: solution for keyword "uuidof" of g++ ?
 
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.



William 01-23-2007 01:29 AM

Re: solution for keyword "uuidof" of g++ ?
 

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 <alfps@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;
> }
>
>



red floyd 01-23-2007 04:46 PM

Re: solution for keyword "uuidof" of g++ ?
 
William wrote:

> On Fri, 19 Jan 2007 11:21:23 +0800, Alf P. Steinbach <alfps@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?




All times are GMT. The time now is 05:51 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.