Eat my own dog food
I have finally set out to "revert" up some of my stupid C++ code written long ago, and I would show case two of my stupid-ness here.
#define SHARED_PTR boost::shared_ptr
This is real. I don't know what the hack I was thinking while writing this line of code. The whole header file is reproduced here in its entirety to celebrate its removal.
#ifndef _HANDLE_HPP #define _HANDLE_HPP #include "boost/shared_ptr.hpp" #define SHARED_PTR boost::shared_ptr #endif /* _HANDLE_HPP */
WTF!?
PS: Probably I was thinking that the file is for "easier" transition to std::shared_ptr once it C++0x is released, but I think everybody would think otherwise.
Favor forward declaration over #include
In short I have been convinced that I should use forward declaration when ever possible.
0 Comments:
Post a Comment
<< Home