FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
C++
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
November 01, 2005

An Efficient Variant Type

(Page 3 of 7)

November, 2005: An Efficient Variant Type

Listing 2



  using namespace cdiggins;
  any a = 3.141;
  double d = a.cast<double>();
  try {
    int n = a.cast<int>();
  }
  catch(bad_any_cast a) {
    cerr << "an exception occured trying to cast from "
      << a.from.name() << a.to.name() << endl;
  }

Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 Next Page
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK