   signed/unsigned class O_O
  I need to create an object that the keywords signed and unsigned can affect... is this possible? if so, then howcould that be opertor signed()  :huh: this should affect the constructor though... any help or refrence is appreciated! ... 
  signed and unsigned are keywords, not operators.;  You have to use templates. ;quote:Original post by Puzzler183  You have to use templates.   thanks, but how exactly?;quote:Original post by Teh Evil  quote:Original post by Puzzler183   You have to use templates.   thanks, but how exactly? Assuming it''s not enough to have just a member or two whose type can be provided in the template, you can use specialization: template<typename T>class SomeClass {};template<>class SomeClass<signed> {public:  void i_am() { std::cout << "I''m a signed SomeClass" << std::endl; }};template<>class SomeClass<unsigned> {public:  void i_am() { std::cout << "I''m an unsigned SomeClass" << std::endl; }};int main() {  SomeClass<signed> foo;  SomeClass<unsigned> bar;  foo.i_am();  bar.i_am();}Not quite "signed SomeClass" vs. "unsigned SomeClass", and there''ll be a _lot_ of code duplication in any nontrivial application since each specialization is basically a completely different class (unless SomeClass<signed> and SomeClass<unsigned> inherit from some common base class, or the common code is generated by macros) but it lets you code different behavior based on some notional "signedness" of the type.This is, in my opinion, a wild abuse of templates of course.  But it''s doable.;  oh that was cool... thanks ;  sorry , I''ve tried what ap said, and a compiler error popserror C2976: ''SomeClass'': too few template arguments ;  Use a newer compiler. ;  Works fine with g++:$ g++ test.cpp -otest.exe -Wall$ ./test.exeI''m a signed SomeClassI''m an unsigned SomeClass;  I use VisualStudio.NET ... :-S 