summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/utils/test_any.cc
diff options
context:
space:
mode:
Diffstat (limited to '2005/i/robert/src/utils/test_any.cc')
-rw-r--r--2005/i/robert/src/utils/test_any.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/2005/i/robert/src/utils/test_any.cc b/2005/i/robert/src/utils/test_any.cc
index e8af644..85d2319 100644
--- a/2005/i/robert/src/utils/test_any.cc
+++ b/2005/i/robert/src/utils/test_any.cc
@@ -33,7 +33,9 @@ main (int argc, char **argv)
any a (45), b (std::string ("toto")), c (5.4), d (std::string ("5"));
try
{
+ // Direct call to output operator.
std::cout << a << ' ' << b << ' ' << c << ' ' << d << std::endl;
+ // Here, it tries to extract the contained data.
std::cout << any_cast<int> (a) << std::endl;
std::cout << any_cast<std::string> (b) << std::endl;
std::cout << any_cast<double> (c) << std::endl;