Sponsored Content
Top Forums Programming stl map - could any one explain the o/p Post 302347594 by johnbach on Wednesday 26th of August 2009 05:23:00 AM
Old 08-26-2009
Question stl map - could any one explain the o/p

Code:
class tst
{
   public:
      tst() {
         cout<<"ctor tst()\n";
      }
      tst(const tst& ob) {
         cout<<"cp ctor tst()\n";
      }
      ~tst()
      {
         cout<<"dtor tst()\n";
      }
};
map<string,tst> mp;
int main(void)
{
   mp["111"];
   //mp["111"]=tst();
}

output:
Code:
ctor tst()
cp ctor tst()
cp ctor tst()
dtor tst()
dtor tst()
dtor tst()

 

7 More Discussions You Might Find Interesting

1. Programming

STL map

Hi there, I am using the STL map and I print the map using: map <string, float> ngram_token_index ; map <string, float>::iterator map_iter ; //read the map ... // print the map for ( map_iter = ngram_token_index.begin() ; map_iter != ngram_token_index.end() ; map_iter++ ) cout << ... (2 Replies)
Discussion started by: superuser84
2 Replies

2. Programming

STL from win

Help me please with STL source code that works on Windows I've found on Inet STL MRU Cache (it compiles fine with Studio 2008), but when trying to build it with Kdevelop (g++ is the compiler) I've got a series of error. One of them I've placed in the source code. If it's important I can post here... (0 Replies)
Discussion started by: Orlando_ua
0 Replies

3. UNIX for Dummies Questions & Answers

c++ stl which rpm?

Hello, I'm using RHEL 5.3, I need to compile C++ code and I'd like to know which rpm contains the STL library. Thanks:) (3 Replies)
Discussion started by: pppswing
3 Replies

4. Programming

which stl is best suited to represent a tree

hi all i have a tree structure: root --- node 1 to node 10 in each node --- sub node 1 to sub node 10 in each sub node --- leaf node 1 to leaf node 10 i have to print this in following fashion: root ---- n1 ---- sn1 ---- l1, l2, l3, ....., l10 n1 ---- sn2 ---- l1, l2, l3,... (2 Replies)
Discussion started by: vidyaj
2 Replies

5. Programming

c++ code to print a tree using stl map

hi all, i need c++ code to print a binary or non binary tree using stl map.... please help me to find the same.......... (1 Reply)
Discussion started by: vidyaj
1 Replies

6. Programming

how to check the value in stl container during debug

Hi, guys. I am working on a project right now. But when I debug my code, I can't see the values in stl container, e.g vector, map. Can anyone help me, please. I am really frustrated:wall:. I am using code::blocks IDE, by the way. Thanks in advance...... (0 Replies)
Discussion started by: tefino
0 Replies

7. Programming

STL transform question

Hi all, I pass to the transform algorithm two vectors, and the suma function. #include <algorithm> #include <iostream> #include <iterator> #include <vector> using namespace std; class Duo{ public: int one; int two; }; Duo suma(Duo first, Duo last){ Duo ret; ... (1 Reply)
Discussion started by: santiagorf
1 Replies
REFLECTIONCLASS(3)							 1							REFLECTIONCLASS(3)

The ReflectionClass class

INTRODUCTION
The ReflectionClass class reports information about a class. CLASS SYNOPSIS
ReflectionClass ReflectionClassReflector Constants o const integer$ReflectionClass::IS_IMPLICIT_ABSTRACT16 o const integer$ReflectionClass::IS_EXPLICIT_ABSTRACT32 o const integer$ReflectionClass::IS_FINAL64 Properties o public$name Methods o public ReflectionClass::__construct (mixed $argument) o publicstatic string ReflectionClass::export (mixed $argument, [bool $return = false]) o public mixed ReflectionClass::getConstant (string $name) o public array ReflectionClass::getConstants (void ) o public ReflectionMethod ReflectionClass::getConstructor (void ) o public array ReflectionClass::getDefaultProperties (void ) o public string ReflectionClass::getDocComment (void ) o public int ReflectionClass::getEndLine (void ) o public ReflectionExtension ReflectionClass::getExtension (void ) o public string ReflectionClass::getExtensionName (void ) o public string ReflectionClass::getFileName (void ) o public array ReflectionClass::getInterfaceNames (void ) o public array ReflectionClass::getInterfaces (void ) o public ReflectionMethod ReflectionClass::getMethod (string $name) o public array ReflectionClass::getMethods ([int $filter]) o public int ReflectionClass::getModifiers (void ) o public string ReflectionClass::getName (void ) o public string ReflectionClass::getNamespaceName (void ) o public object ReflectionClass::getParentClass (void ) o public array ReflectionClass::getProperties ([int $filter]) o public ReflectionProperty ReflectionClass::getProperty (string $name) o public string ReflectionClass::getShortName (void ) o public int ReflectionClass::getStartLine (void ) o public array ReflectionClass::getStaticProperties (void ) o public mixed ReflectionClass::getStaticPropertyValue (string $name, [mixed &$def_value]) o public array ReflectionClass::getTraitAliases (void ) o public array ReflectionClass::getTraitNames (void ) o public array ReflectionClass::getTraits (void ) o public bool ReflectionClass::hasConstant (string $name) o public bool ReflectionClass::hasMethod (string $name) o public bool ReflectionClass::hasProperty (string $name) o public bool ReflectionClass::implementsInterface (string $interface) o public bool ReflectionClass::inNamespace (void ) o public bool ReflectionClass::isAbstract (void ) o public bool ReflectionClass::isCloneable (void ) o public bool ReflectionClass::isFinal (void ) o public bool ReflectionClass::isInstance (object $object) o public bool ReflectionClass::isInstantiable (void ) o public bool ReflectionClass::isInterface (void ) o public bool ReflectionClass::isInternal (void ) o public bool ReflectionClass::isIterateable (void ) o public bool ReflectionClass::isSubclassOf (string $class) o public bool ReflectionClass::isTrait (void ) o public bool ReflectionClass::isUserDefined (void ) o public object ReflectionClass::newInstance (mixed $args, [mixed $...]) o public object ReflectionClass::newInstanceArgs ([array $args]) o public object ReflectionClass::newInstanceWithoutConstructor (void ) o public void ReflectionClass::setStaticPropertyValue (string $name, string $value) o public string ReflectionClass::__toString (void ) PROPERTIES
o $name - Name of the class. Read-only, throws ReflectionException in attempt to write. PREDEFINED CONSTANTS
REFLECTIONCLASS MODIFIERS
o ReflectionClass::IS_IMPLICIT_ABSTRACT - Indicates class that is abstract because it has some abstract methods. o ReflectionClass::IS_EXPLICIT_ABSTRACT - Indicates class that is abstract because of its definition. o ReflectionClass::IS_FINAL - Indicates final class. PHP Documentation Group REFLECTIONCLASS(3)
All times are GMT -4. The time now is 03:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy