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

  • Home
  • SEARCH
  • 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 8718905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:39:38+00:00 2026-06-13T06:39:38+00:00

I got what POD means, and I know that when I declare a structure

  • 0

I got what POD means, and I know that when I declare a structure in C++ as

struct f {};

there’s a default constructor, a default copy constructor, a default destructor, etc.. (if I got this correctly)

My question is: how can I declare a POD structure with just plain data (like 4 int values) without implicit constructors/destructors/etc.. getting in the way?

Did I miss something?

  • 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-13T06:39:39+00:00Added an answer on June 13, 2026 at 6:39 am

    Every object type has a constructor—else how would you construct it?—and a destructor—else how would it be destroyed? They don’t “get in the way” of anything, because the default implementations are no-ops in the case of POD-only fields, just as if you had said:

    struct f {
        f() {}
        ~f() {}
        int a, b, c, d;
    };
    

    However, if you write an empty constructor, the type becomes non-POD. C++11 solves this with defaulting:

    f() = default;
    ~f() = default;
    

    The situation is slightly different with copy constructors, where the implicitly generated one is just a convenience that does “the right thing” for POD types:

    f(const f& other) : a(other.a), b(other.b), c(other.c), d(other.d) {}
    

    There is no reason to rewrite this yourself. If you want to make a type noncopyable, you can mark the copy constructor as deleted with f(const f&) = delete; or declare it private.

    It’s also important to note that member functions are not stored on the object as member variables are. You can think of a class or struct as simultaneously two things:

    1. A description of a data layout

    2. A namespace containing functions and types for manipulating that data

    The C++ model of object-oriented programming simply couples these two things in one place.

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

Sidebar

Related Questions

Got solution - See bottom of the post Just want to know if there
Got this error message while trying to load view: The model item passed into
Got a question for some jQuery wizard who might stumble upon this. When I
Got a seg fault from my memcpy that gdb can't give me anything else
got a problem, can't get my head around this jquery and would appreciate your
got some problems. Built an applet that has to be used step-by-step. After each
Got datatable with Id, parentId, description. It is a relationial table structure. I want
Got this errors keeps appeared repeatedly Here is my line 20 on functions.php $wp_query->max_num_pages
Got that error when trying to push updated app to Heroku (probably the same
Got a style conflict between StyleCop and Resharper. Stylecop 1303 says that const vars

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.