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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:49:12+00:00 2026-05-31T03:49:12+00:00

I ran the below with g++ -std=c++0x pod_test.cpp on g++ 4.6.2 (mingw). I get

  • 0

I ran the below with g++ -std=c++0x pod_test.cpp on g++ 4.6.2 (mingw). I get an error on A4. Why isn’t A4 POD?

#include <iostream>
#include <new>
#include <cstring>

using namespace std;

struct A {
    int a, b;
    char c;
};
struct A2 {
    short buf[1];
};
struct A3:A {
};
struct A4:A {
    short buf[1];
};
static_assert(std::is_pod<A>::value, "Struct must be a POD type");
static_assert(std::is_pod<A2>::value, "Struct must be a POD type");
static_assert(std::is_pod<A3>::value, "Struct must be a POD type");
static_assert(std::is_pod<A4>::value, "Struct must be a POD type");

int main(){}
  • 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-31T03:49:13+00:00Added an answer on May 31, 2026 at 3:49 am

    It’s not POD because it breaks this rule for standard layout classes:

    — either has no non-static data members in the most derived class and
    at most one base class with non-static data members, or has no base
    classes with non-static data members

    Only one class in the inheritance lattice can have non-static data members. In this case, both
    A and A4 have.

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

Sidebar

Related Questions

I made a file hi.cpp and I wrote the command given below: #include <iostream>
I got the above error message when I ran my test. Below is my
I've just started with opengl but I ran into some strange behaviour. Below I
Ran across this line of code: FormsAuth = formsAuth ?? new FormsAuthenticationWrapper(); What do
Ran into an Out of Stack Space error trying to serialize an ASP.Net AJAX
Below is a program i have written that ran fine when I type what
I ran the below script to set environment variables for oracle(oracle_env.sh which comes with
When i ran the below queries it's failing in the second query becuase prev_test_ref1
I ran across the question below in an old exam. My answers just feels
When I ran the SQL query below, the performance is really slow. There are

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.