Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8111771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:14:41+00:00 2026-06-06T02:14:41+00:00

A college at work created a class with only static methods. Because he wants

  • 0

A college at work created a class with only static methods. Because he wants to avoid instantiation, he added a (private) constructor. That’s fine so far. But the constructor is only declared and has no implementation. Thus you will get an “undefined reference” when using it once.

Imho it must be enough to make the constructor private – and declarations without implementation is ugly. What is your opinion about this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T02:14:43+00:00Added an answer on June 6, 2026 at 2:14 am

    I see your concern.

    In fact, making a copy-constructor private and then leave it unimplemented, is a common practice, and it is certainly necessary in certain cases. This has led to the definition of a well-known C++ idiom, the Non Copyable Mixin to give it more “visibility”. But even when the non copyable mixin is not used and the solution is applied locally, it is IMO perfectly acceptable (because it is a known idiom).

    In your specific case, since as I understand we are not talking about copy constructors, but any constructors (the class is just a container for some static methods and you do not want it to be initialized), I think using a namespace and declaring your functions within it would be a better solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I work at a small college that wants to make sites for all of
I work at a college that uses an intranet based student management solution not
I'm doing work for college and I have to determine, which of the three
I work at a college and our student management systems academic year start date
As part of a college project, I'd like to deploy a system that compares
For an assignment in college, we have to make a script in Perl that
I did a little GP (note:very little) work in college and have been playing
I have a college project that I want to do as 3 Tier Winform
Last semester in college, my teacher in the Computer Languages class taught us the
Background I graduated 6 months ago, and my collaborative work in college has all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.