Tuesday, May 28, 2013  Strongly Typed (and Named) Primitives
Quick note: this post can be classified under "language abuse".
If you don't get it, don't worry, you're probably better off
that way. :)  struct SpecialPrimitive  enum class Value   One =
1,   SpecialPrimitive(Value i) : _value((int)i) {}  void
operator=(Value i) { _value = (int)i; }  operator int&() {
return _value; }  operator const int&() const { return _value; }
int _value;  int main()   // SpecialPrimitive p = 42; will not
compile  SpecialPrimitive p = SpecialPrimitive::Value::Two;
cout << p << endl;    // again, p = 69; will not compile  p =
SpecialPrimitive::Value::Three;   cout << p << endl;  This
extendable kind of enum class, lets you deserialize ints into
it, while still getting the *compile time* benefits of an enum
class. Note that it might be a good idea to perform validation
after deserialization, depending on your context.  Thursday,
April 4, 2013  Custom Exceptions  Regarding local applications,
and not public APIs, here's a q