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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:05:20+00:00 2026-06-03T14:05:20+00:00

I came across this code. class SomeClass::OtherClass : public BaseClass { // stuff in

  • 0

I came across this code.

class SomeClass::OtherClass : public BaseClass
{
  // stuff in here
}

SomeClass is a class, so maybe OtherClass is a class that exists inside the scope of SomeClass? I’ve just never seen it done this way.

So, is that what it means?

  • 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-03T14:05:21+00:00Added an answer on June 3, 2026 at 2:05 pm

    maybe OtherClass is a class that exists inside the scope of SomeClass?

    Give yourself a checkmark. That is what it means.

    This is used to subsequently define OtherClass after it was declared inside SomeClass:

    class SomeClass {
        class OtherClass;
        OtherClass* GetOtherClassInstance() { ...}
    };
    class SomeClass::OtherClass {
    } 
    

    One might do this if the inner class only makes sense in the context of the exterior class.

    class Vector {
      class Iterator;
      Iterator* GetStart();
    };
    class Vector::Iterator {
       details.
    }
    

    As mentioned elsewhere, the pimpl idiom is an excellent use of inner classes with deferred definition.

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

Sidebar

Related Questions

I recently came across a piece of code: public class SomeClass { private Logger
I came across this strange code snippet which compiles fine: class Car { public:
I came across this code on reddit . I would have thought that type
I came across some legacy code that contains a function like this: LPCTSTR returnString()
I came across this article on Code Project that talks about using an abstract
Im creating a model in qt and came across this code: class StringListModel :
While writing some code i came across this issue: #include <iostream> class random {
I came across this code just few minutes back here in Stack Overflow. I
Yesterday I read some code of a colleague and came across this: class a_class
I came across this code in a php database class: if( !$this->_Link_ID ) Link_ID

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.