Boost logo

Boost Users :

From: Christian Henning (chhenning_at_[hidden])
Date: 2007-03-23 11:16:23


Ups, small error on my side. The code that compiles is like this:

#include <string>

#include <boost/any.hpp>

using namespace std;
using namespace boost;

struct A {};
struct B {};

struct string_table
{
   const any a;
   const string s;
};

static string_table table[] =
{
   { any( A() ), "Hello" },
   { any( B() ), "Moin" }
};

Sorry for the noise,
Christian

On 3/23/07, Christian Henning <chhenning_at_[hidden]> wrote:
> Hi there, is the following code possible?
>
> #include <string>
>
> #include <boost/any.hpp>
>
> using namespace std;
> using namespace boost;
>
> struct A {};
> struct B {};
>
> struct string_table
> {
> const any a;
> const string s;
> };
>
> static string_table table[] =
> {
> { any( A ), "Hello" },
> { any( B ), "Moin" }
> };
>
> How would you implement such functionality?
>
> Thanks ahead,
> Christian
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net