Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shouldn't declare the constructor of ThreadLocalSingleton to be private? #2

Closed
chuchao333 opened this issue Mar 12, 2013 · 3 comments
Closed

Comments

@chuchao333
Copy link

just as in Singleton

@chenshuo
Copy link
Owner

What do you think the purpose of boost::noncopyable base class is?

@chuchao333
Copy link
Author

sorry if I didn't state it clearly, what I meant is the default
constructor, like you wrote in Singleton class:

private:
Singleton();
~Singleton();

As I understand, boost::noncopyable only declared the copy constructor
and assigment operator to be private,

for you current ThreadLocalSingleton class, I think user can still
write sth like:

ThreadLocalSingleton t1, t2, t3;

On Tue, Mar 12, 2013 at 11:17 PM, Shuo Chen notifications@github.comwrote:

What do you think the purpose of boost::noncopyable base class is?


Reply to this email directly or view it on GitHubhttps://github.com//issues/2#issuecomment-14781132
.

ChuChao

@chenshuo
Copy link
Owner

You are right, thank you. fixed,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants