S
shendaras
Hello,
I have a quick question about the syntax I should use to initialize a
static member variable which is non-copyable (boost::noncopyable, in
fact).
class non_copyable : private boost::noncopyable { /* ... */ };
class xyxxy { /* ... */
static non_copyable foo;
};
/* ... */
non_copyable xyxxy::foo; /* looks like a declaration to me */
non_copyable xyxxy::foo = non_copyable(); /* no copies allowed */
non_copyable xyxxy::foo(non_copyable()); /* function declaration */
non_copyable xyxxy::foo((non_copyable())); /* nope, doesn't work either
*/
I've been using "non_copyable xyxxy::foo;" but this looks wrong to me.
What's the appropriate way to initialize foo, as per the above
pseudo-code?
Thanks!
I have a quick question about the syntax I should use to initialize a
static member variable which is non-copyable (boost::noncopyable, in
fact).
class non_copyable : private boost::noncopyable { /* ... */ };
class xyxxy { /* ... */
static non_copyable foo;
};
/* ... */
non_copyable xyxxy::foo; /* looks like a declaration to me */
non_copyable xyxxy::foo = non_copyable(); /* no copies allowed */
non_copyable xyxxy::foo(non_copyable()); /* function declaration */
non_copyable xyxxy::foo((non_copyable())); /* nope, doesn't work either
*/
I've been using "non_copyable xyxxy::foo;" but this looks wrong to me.
What's the appropriate way to initialize foo, as per the above
pseudo-code?
Thanks!