Hi,
i use the following map:
std::map<Key, std::vector< std::string >, KeyCmp mSQLElem;
The following code does not insert the newly created pair:
std::vector<std::stringvcTemp;
vcTemp.push_back("test string");
mSQLBody.insert(std::make_pair(Key(stKey, mSQLBody.size(),
b_is_key_unique), std::vector< std::string >(vcTemp)));
Thanks for your help!
Simon
////////////////////////////////////////////
The Key class is:
class Key {
public:
std::string stKeyName;
bool bFilled;
bool b_is_unique; // should this node be unique in the pattern
int iPosition;
Key(std::string a_stKeyName, int a_iPosition=-1, bool
a_b_is_unique=false) : stKeyName(a_stKeyName), iPosition(a_iPosition),
bFilled(false), b_is_unique(a_b_is_unique)
{}
Key(const Key &a_key);
Key &operator=(const Key &a_key);
void clear();
};
and KeyCmp class:
class KeyCmp {
public:
bool operator()(Key const &, Key const &) const;
}; 1 1504
My question is no more valid: I was looking at the wrong part of code.
Sorry
On Nov 4, 11:48 pm, simon.el...@free.fr wrote:
Hi,
i use the following map:
std::map<Key, std::vector< std::string >, KeyCmp mSQLElem;
The following code does not insert the newly created pair:
std::vector<std::stringvcTemp;
vcTemp.push_back("test string");
mSQLBody.insert(std::make_pair(Key(stKey, mSQLBody.size(),
b_is_key_unique), std::vector< std::string >(vcTemp)));
Thanks for your help!
Simon
////////////////////////////////////////////
The Key class is:
class Key {
public:
std::string stKeyName;
bool bFilled;
bool b_is_unique; // should this node be unique in the pattern
int iPosition;
Key(std::string a_stKeyName, int a_iPosition=-1, bool
a_b_is_unique=false) : stKeyName(a_stKeyName), iPosition(a_iPosition),
bFilled(false), b_is_unique(a_b_is_unique)
{}
Key(const Key &a_key);
Key &operator=(const Key &a_key);
void clear();
};
and KeyCmp class:
class KeyCmp {
public:
bool operator()(Key const &, Key const &) const;
};
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Christopher |
last post by:
I am having problems iterating through the sequence of objects stored in my
std::map I want to call a function from the "value" object in the map. Here
is my snippet:
typedef std::map<SOCKET,...
|
by: Antti Granqvist |
last post by:
Hello!
I have following object relations:
Competition 1--* Category 1--* Course
1
|
|
*
Course
|
by: cppaddict |
last post by:
Hi,
I'm confused about what the comparison operator in a map template is:
In particular, I want to know why something like the following doesn't
work:
bool pointCompare(POINT p1, POINT p2)...
|
by: Flzw |
last post by:
Well I have a map like this :
std::map <string, CObject> ObjectList;
I have a function like this :
CObject* NewObject( char* Name, CArg* Arg)
{
std::string key = Name;
ObjectList =...
|
by: Saeed Amrollahi |
last post by:
Dear All C++ Programmers
Hello
I am Saeed Amrollahi. I am a software engineer in
Tehran Sewerage Company. I try to use std::map and map::find member
function. I
use Visual Studio .NET. my...
|
by: kamaraj80 |
last post by:
Hi
I am using the std:: map as following.
typedef struct _SeatRowCols
{
long nSeatRow;
unsigned char ucSeatLetter;
}SeatRowCols;
typedef struct _NetData
|
by: aaragon |
last post by:
Hello everyone,
I would like to know if there is a way to use the std::map to store
different types for one of its two types. That is, I'm trying to use
it as:
typedef...
|
by: Diwa |
last post by:
Does the "value" type (value as in key-value pair )of "std::map"
require a default ctor even if it is not used ?
If I comment out Line 1 in the code attached later,
i.e remove the default ctor...
|
by: guido |
last post by:
Hi,
I'm looking for a container class that can map whole ranges of keys to
objects - something like std::map, but not only for individual values for
the key, but for whole ranges.
Example:
I...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |