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 6078077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:47:34+00:00 2026-05-23T10:47:34+00:00

In layman’s terms, what’s the difference between trivial types, standard layout types and PODs?

  • 0

In layman’s terms, what’s the difference between trivial types, standard layout types and PODs?

Specifically, I want to determine whether new T is different from new T() for any template parameter T. Which of the type traits is_trivial, is_standard_layout and is_pod should I choose?

(As a side question, can any of these type traits be implemented without compiler magic?)

  • 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-05-23T10:47:34+00:00Added an answer on May 23, 2026 at 10:47 am

    I don’t think it can be done in truly layman’s terms, at least without a lot of extra explanation. One important point is static vs. dynamic initialization, but explaining that to a layman would be several pages in itself…

    PODs were (mis-)defined in C++98. There are really two separate intents involved, neither expressed very well: 1) that if you compile a C struct declaration in C++, what you get should be equivalent to what you had in C. 2) A POD will only ever need/use static (not dynamic) initialization.

    C++0x/11 drops the “POD” designation (almost) entirely, in favor of “trivial” and “standard layout”. Standard layout is intended to capture the first intent — creating something with a layout the same as you’d get in C. Trivial is intended to capture the support for static initialization.

    Since new T vs. new T() deals with initialization, you probably want is_trivial.

    I’m not sure about compiler magic being required. My immediate reaction would be probably yes, but knowing some of the things people have done with TMP, I have a hard time being certain somebody couldn’t do this too…

    Edit: for examples, perhaps it’s best to just quote the examples from N3290:

    struct N { // neither trivial nor standard-layout
       int i;
       int j;
        virtual ~N();
    };
    
    struct T { // trivial but not standard-layout
        int i;
    private:
        int j;
    };
    
    struct SL { // standard-layout but not trivial
        int i;
        int j;
        ~SL();
    };
    
    struct POD { // both trivial and standard-layout
        int i;
        int j;
    };
    

    As you can undoubtedly guess, POD is also a POD struct.

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

Sidebar

Related Questions

What is the difference between the following concepts in layman terms: spinning lock, blocking
Can anyone please provide me in layman's terms the difference between developing a JRuby
Please describe the .NET assembly compilation circular dependency problem in layman's terms, and whether
Possible Duplicate: A clear, layman’s explanation of the difference between | and || in
I'm new to C#, and thus am looking for layman's terms regarding this. Essentially,
As a layman, how do I understand the difference between web server and application
What would this statement do: ServerSocket ss=new ServerSocket(4646); Please explain in layman terms.
Possible Duplicates: A clear, layman's explanation of the difference between | and || in
What is the difference, please explain them in laymen's terms with examples. Thanks!
In layman's terms, what is a unit of work in regards to database objects?

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.