|
|
Up |
|
|
  |
Author: Giuliano BertolettiGiuliano Bertoletti
Date: Sep 20, 2008 12:19
Hello,
I'm experiencing a strange problem with STL's set and maps (probably I'm
misusing the container).
When I instantiate a type like this:
std::set myset;
I'm required to define an operator < for CMyclass in order for the set
(and map) to work.
However I'm wondering why I am not forced to define also an operator ==
(if I do, it is ignored) since to check whether a certain object is in
the set I need to test for exact match and not only for a greater/lesser
relation.
For example:
CMyclass A;
// fill A with proper data
// ...
|
| Show full article (1.08Kb) |
|
| |
no comments
|
|
  |
Author: Rune AllnorRune Allnor
Date: Sep 20, 2008 09:07
Hi folks.
I have some classes which are derived from some base:
class base {
void foo();
void bar();
};
class a : public base {
};
class b: public base{
};
The problem is as follows:
1) I would like to prevent users from making instances of
class base
2) There are no overloaded functions beween the base class
and the derived classes, so I can not use the usual
virtual void overloaded_function() = 0;
in the base class.
As far as I can see, there are two ways to proceed:
|
| Show full article (0.80Kb) |
|
| |
5 Comments |
|
  |
Author: Pallav singhPallav singh
Date: Sep 20, 2008 04:32
Hi All,
i am getting error during explicit function Instantiation for a class
Template
if i do explicit Instantiation of class it work and all function
symbol i get in object file
But if i try to expose only one function of my class its failing
#include
template
class A
{
const T max(const T a,const T b)
{ return ((a
const T min(const T a,const T b)
{ return ((a
};
// used for Explicit Instantiation of class
//template class A;
|
| Show full article (0.68Kb) |
|
3 Comments |
|
  |
Author: PeterAPIITPeterAPIIT
Date: Sep 20, 2008 02:34
Hello to all expect C++ programmer, recently i have developed a smart
pointer class but i don't know how to implement a reference counting.
My smart pointer is non-intrusive smart pointer.
My question is
1. I need a simple reference count ptr class
2. Does cyclic reference counting can be solved ?
3. Does policy based design is good approaches in smart pointer ?
4. What should i define in smart pointer template class ?
5. Does smart pointer syntax correct ?
In STL, there just write class U = XXX but why i need the template
. What this mean ?
I know what is template.
This is my code so far.
[code]
template
template
class StoragePolicy = DefaultSPStorage,
template
class OwnershipPolicy = RCPtr,
|
| Show full article (2.78Kb) |
|
1 Comment |
|
  |
Author: cicitrade01cicitrade01
Date: Sep 20, 2008 01:32
hi
We are supplier in china Footwear Apparel Handbags Jeans&Pants Cap
Accessory
1) Top quality, reasonable price, safe shipping, and best service
2) Sport shoes for men, women and kids with all sizes available
3) Sport shoes with different colors and styles available in stock
4) The material and size can be required to make in accordance with
customers' requests
Price :8-35usd 6-30EURO 5-30Pounds
size chart
Men Size:
US: 7 8 8.5 9 9.5 10 10.5 11 11.5 12 13 14 15
UK: 6 7 7.5 8 8.5 9 9.5 10 10.5 11 12 13 14
EUR: 40 41 42 42.5 43 44 44.5 45 45.5 46 47.5 48 49
Women Size:
US: 5 5.5 6 6.5 7 7.5 8 8.5
UK: 2.5 3 3.5 4 4.5 5 5.5 6
EUR: 35.5 36 36.5 37.5 38 38.5 39 40
|
| Show full article (1.23Kb) |
|
no comments
|
|
  |
Author: solanki.chandrakantsolanki.chandrakant
Date: Sep 19, 2008 22:42
Hi
I have downloaded install ACE 5.6.6
Installation Step
01] cd /usr/src/ACE_wrappers
02] mkdir objdir
03] cd objdir
04] ../configure
05] make && make install
06] export ACE_ROOT=/usr/src/ACE_wrappers
07] export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ACE_ROOT/ace
08] cd /usr/src/ACE_wrappers/ace
09] ln-s config-linux.h config.h
10] ln -s platform_linux.GNU platform_macros.GNU ln-s
platform_linux.GNU platform_macros.GNU
Then I have return simple program.. named "client.cpp"
#include "/usr/src/ACE_wrappers/ace/Log_Msg.h"
void foo(void);
|
| Show full article (4.73Kb) |
|
no comments
|
|
  |
|
|
  |
Author: ReshmiReshmi
Date: Sep 19, 2008 19:48
Hi,
I have this C code which does complex number arithmetic. When I try to
write a similar file for C++, it says that "creal’ was not declared in
this scope". Can anyone give a better idea to write it using
"complex.h", other than using own data structures?
#include
#include
int main(){
// double pi = 4*atan2(1);
double complex A = 32 + 24*I;
double complex B = 64 + 48*I;
double complex sum = A + B;
printf("\na is %%f + %%fi\n",creal(A), cimag(A));
printf("b is %%f + %%fi\n",creal(B), cimag(B));
printf("sum is %%f + %%fi\n",creal(sum), cimag(sum));
printf("sum: abs = %%f , angle = %%f\n", cabs(sum), carg(sum));
return(0);
}
|
| Show full article (0.71Kb) |
|
3 Comments |
|
  |
Author: dnuthtsasodnuthtsaso
Date: Sep 19, 2008 16:17
using Dev C++ 4.9.9.2 there is a template for a windows app where do i
put my code in it? or does anyone know any other code i could use to
make a window?
|
| |
|
2 Comments |
|
  |
|
|
  |
Author: Peng YuPeng Yu
Date: Sep 19, 2008 14:22
Hi,
The following code doesn't work at the commented line. I'm wondering
why C++ grammar is defined this way. Shouldn't C++ be smarter enough
to figure out whether an member function or a free function shall be
used?
Thanks,
Peng
#include
struct A {
A(int a) : _a(a) { }
int _a;
};
void doit(const A &a) {
std::cout << a._a << std::endl;
}
|
| Show full article (0.61Kb) |
|
4 Comments |
|
|
|
|
|
|