Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. static constructors and destructors in C++

static constructors and destructors in C++

Scheduled Pinned Locked Moved C / C++ / MFC
c++
22 Posts 7 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Navier

    Seems to me like a Singleton pattern would do the job better. BTW the standard (well Nov96 draft at least) says a constructor can't have a static modifier (12.1 para 4) if you want official confirmation. i1.2sqrt(u).bcos(ur)sec(c) but b4.isqrt(u).ru/16

    R Offline
    R Offline
    Ravi Bhavnani
    wrote on last edited by
    #21

    I think the Singleton pattern is better suited when you want to expose methods from the one and only instance of a class. But I agree that the ClassFactory pattern can do more than serve up a single class. In fact, it's power lies in the fact that it can serve up specializations of a general base class. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

    1 Reply Last reply
    0
    • N Nish Nishant

      [removed]

      H Offline
      H Offline
      Hugo Gonzalez Castro
      wrote on last edited by
      #22

      Maybe this article is useful for you: Static Constructor and Destructor in C++

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups