object as function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • babu198649
    New Member
    • Sep 2007
    • 22

    object as function

    hi,i came across a program where one line goes like this

    SQ_Config::inst ance()->readBoolEntry( "mount_devi ce", false)

    here i found that SQ_Config is a class but there is no function called
    instance().i had ran the program and it works fine.
    please clarify thanks in advance.
  • Savage
    Recognized Expert Top Contributor
    • Feb 2007
    • 1759

    #2
    Originally posted by babu198649
    hi,i came across a program where one line goes like this

    SQ_Config::inst ance()->readBoolEntry( "mount_devi ce", false)

    here i found that SQ_Config is a class but there is no function called
    instance().i had ran the program and it works fine.
    please clarify thanks in advance.
    Are you sure that there is no method called instance?

    This is singleton class,which means that inside the class there must be a static pointer to the class,in this case instance().Is this class derived?

    Savage

    Comment

    • Studlyami
      Recognized Expert Contributor
      • Sep 2007
      • 464

      #3
      You can also use a debugger to follow the code. Stop it at that line and step through the program to see where the program ends up.

      Comment

      Working...