This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: compile or not compile


Eljay Love-Jensen wrote:
Hi Karol,

Okay, then do this:

-----------------------------
// SECOND_CASE
typedef int my_int;

class ALibraryClass
{

public:
   int foo(const my_int&)
       {
           return 0;
       }
   int foo(const bool&)
       {
           return 0;
       }
};

class BClientClass
{
   public:
   enum Items
   {
       item1=1000,
       item2=2000
   };
   void test()
   {
       ALibraryClass a;
       a.foo(int(BClientClass::item1));
   }
};

int main()
{
   BClientClass b;
   b.test();
   return 0;
}
-----------------------------

And everything should work as desired.

HTH,
--Eljay


Hi!


Casting in my case is no option because in real program I have many
lines like:
              a.foo(BClientClass::item1);

Greets,Karol


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]