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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:37:30+00:00 2026-05-30T14:37:30+00:00

this is my class: #ifndef POINTPOOL_H_ #define POINTPOOL_H_ #include <list> #include <iostream> #include ofPoint.h

  • 0

this is my class:

#ifndef POINTPOOL_H_
#define POINTPOOL_H_

#include <list>
#include <iostream>

#include "ofPoint.h"

// adapted from https://gist.github.com/1124832

class PointPool
{
    private:
        std::list<ofPoint*> resources;
        static PointPool* instance;

        PointPool() {};

    public:
        ~PointPool() {};                      // 1
        static pointPool* getInstance()       // 2
        {
            if (instance == 0)
            {
                instance = new PointPool();
            }
            return instance;
        }

        Resource* getPoint()
        {
            if (resources.empty())
            {
                std::cout << "Creating new." << std::endl;
                return new ofPoint();
            }
            else
            {
                std::cout << "Reusing existing." << std::endl;
                ofPoint* resource = resources.front();
                resources.pop_front();
                return resource;
            }
        }

        void disposePoint(ofPoint* object)
        {
            object->x = 0;
            object->y = 0;
            object->z = 0;
            resources.push_back(object);
        }
};

PointPool* PointPool::instance = 0;

#endif /* POINTPOOL_H_ */

i get

expected unqualified-id at end of input

at comment 1 and

expected ‘;’ before ‘*’ token

at comment 2 i tried to google but i don’t fine a link between this compiler message error and my code..

  • 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-30T14:37:31+00:00Added an answer on May 30, 2026 at 2:37 pm

    You need to change this:

    static pointPool* getInstance()
    

    To this:

    static PointPool* getInstance()
    

    The semicolons after your constructor and destructor are also unnecessary. And, as Ed mentioned, the definition of PointPool::instance must not be in the header.

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

Sidebar

Related Questions

I have this class header //header for class. #ifndef Container_H #define Container_H #include <iostream>
I have this definition for my Test class: #ifndef TEST_H #define TEST_H #include <iostream>
I have a class List: #ifndef UTIL_H #define UTIL_H #include <iostream> #include <exception> namespace
I have this a class called PPString: PPString.h #ifndef __CPP_PPString #define __CPP_PPString #include "PPObject.h"
This is the dependent class header #ifndef TransHeader #define TransHeader #include <string> #include CipherHeader.h
I just created this new class : //------------------------------------------------------------------------------ #ifndef MULTITHREADEDVECTOR_H #define MULTITHREADEDVECTOR_H //------------------------------------------------------------------------------ #include
I have created MutexCondition class like this /*MutexCondtion.h file*/ #ifndef MUTEXCONDITION_H_ #define MUTEXCONDITION_H_ #include
#ifndef IMAGEDATA_H #define IMAGEDATA_H #include <iostream> #include <vector> class ImageData { public: std::string foo;
File ex1.hpp (definition of template class): #ifndef EX1_HPP #define EX1_HPP #include ex2.hpp template <class
I've created my own model class: #ifndef FILE_LISTING_MODEL_H #define FILE_LISTING_MODEL_H #include <QAbstractItemModel> #include <QStringList>

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.