Új hozzászólás Aktív témák
-
cog777
senior tag
Udv!
A memoria szivargas kereso g++ alatt remekul mukodik az std::map sajat allocatorral. Viszont Blackberry alatt a qcc nem birja leforditani.
Itt a cod:
Igy hasznalom:
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <map>
#include "allocator.h"
#include "mynew.h"
#undef new
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
typedef struct node node_t;
struct node {
void * ptr;
bool array;
unsigned int line;
const char *file;
};
std::map<void *, node_t *, std::less<void *>,
fooStdAllocator<std::pair<void *, node_t *> > > booking;Hibauzenetek:
/Applications/bbndk/target_10_1_0_1020/qnx6/usr/include/cpp/xtree:174:51: error: no type named 'difference_type' in 'std::_Tree<std::_Tmap_traits<void*, node*, std::less<void*>, fooStdAllocator<std::pair<void*, node*> >, false> >::allocator_type {aka class fooStdAllocator<std::pair<void* const, node*> >}'
...
/Applications/bbndk/target_10_1_0_1020/qnx6/usr/include/cpp/xtree:189:8: error: no type named 'difference_type' in 'std::_Tmap_traits<void*, node*, std::less<void*>, fooStdAllocator<std::pair<void*, node*> >, false>::allocator_type {aka class fooStdAllocator<std::pair<void* const, node*> >}'
../src/mynew.cpp: In function 'void removeFromList(void*, bool)':
../src/mynew.cpp:42:64: error: conversion from 'std::_Tree<std::_Tmap_traits<void*, node*, std::less<void*>, fooStdAllocator<std::pair<void*, node*> >, false> >::iterator' to non-scalar type 'std::map<void*, node*>::iterator {aka std::_Tree<std::_Tmap_traits<void*, node*, std::less<void*>, std::allocator<std::pair<void* const, node*> >, false> >::iterator}' requested
../src/mynew.cpp:44:28: error: no match for 'operator!=' in 'itr != booking.std::map<void*, node*, std::less<void*>, fooStdAllocator<std::pair<void*, node*> > >::<anonymous>.std::_Tree<_Traits>::end [with _Traits = std::_Tmap_traits<void*, node*, std::less<void*>, fooStdAllocator<std::pair<void*, node*> >, false>]()'
...
../src/mynew.cpp:46:26: error: no matching function for call to 'std::map<void*, node*, std::less<void*>, fooStdAllocator<std::pair<void*, node*> > >::erase(std::map<void*, node*>::iterator&)'Ha van valakinek otlete, orulnek neki ha megosztana hogy merre induljak el.
[ Szerkesztve ]
HP ZBook Studio 15.6 G8 Mobile Workstation - Windows 11
Új hozzászólás Aktív témák
● ha kódot szúrsz be, használd a PROGRAMKÓD formázási funkciót!