Just another WordPress.com site

Archive for May, 2006

A Beta life through Chemistry

Well, yesterday we went to watch a recording of QI in London, so I think I’m a day behind the truly hardcore geeks out there.
 
Never mind, I’m busy maxing out the ole’ broadband aquiring Vista Beta 2 and Office 2007 Beta 2. Which should make for an interesting time. I hope ellie wasn’t too attached to word looking like it did.
 
In other news QI was good – Rory Bremner isn’t as funny as he thinks he is, but never mind. It wasn’t as repetitive and stop-start as I’d imagined it was going to be, so that’s cool. Stephen Fry is bigger than I imagined.
 
And as a corollary to the Syntax attacks series –
 
There’s a file format in my current project which stores flags associated with the data in a double – who knows why…
I wanted to store an enum in the double – putting it in was fine. But pulling it out had to be done by first casting to an int and then to an enum, static_cast<enum> should have worked but it didn’t.
 
Madness.

When Syntax attacks – 2

I found a neatish solution to the problem I was having before. It relies on overriding the () operator – and hence creating a "function object" – of functor if you’re into ridiculous shortened words.
 
Which essentially turns your pointer to your object into a function pointer – without the need to store the object anywhere.
 
Which is marvellous. (Except you can only have one function per object this way.)
 
If you’re into template metaprogramming you can create a template for a Delegate like a .NET delegate this way. Which solves many problems and is lovely.
Design a site like this with WordPress.com
Get started