title: Storing a list of arbitrary objects in C++
body: <p>In Java, you can have a List of Objects. You can add objects of multiple types, then retrieve them, check their type, and perform the appropriate action for that type.<br>
  For example: (apologies if the code isn't exactly correct, I'm going from memory)</p>
  
  <pre><code>List&lt;Object&gt; list = new LinkedList&lt;Object&gt;();
  
  list.add("Hello World!");
  list.add(7);
  list.add(true);
  
  for (object o : list)
  {
      if (o instanceof int)
          ; // Do stuff if it's an int
      else if (o instanceof String)
          ; // Do stuff if it's a string
      else if (o instanceof boolean)
          ; // Do stuff if it's a boolean
  }
  </code></pre>
  
  <p>What's the best way to replicate this behavior in C++?</p>