* 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?