Question Loki's LokiTypeInfo.h

c++ moderated

Question re: Loki's LokiTypeInfo.h

Postby Frank » Mon, 01 Nov 2004 19:53:17 GMT

When compiling with VisualStudio 2003.net (_MSC_VER >= 1301) the
LokiTypeInfo.h forwards to Borland rather than one of the earlier MSVC
versions or the reference version.

ie:

#           elif (_MSC_VER >= 1301)
#               include "Borland/LokiTypeInfo.h"           <<<<<<<<
#       elif (_MSC_VER >= 1300)
#               include "MSVC/1300/LokiTypeInfo.h"
#       elif (_MSC_VER >= 1200)
#               include "MSVC/1200/LokiTypeInfo.h"
#       else
#               include "Reference/LokiTypeInfo.h"

whereaas most of the other Loki headers forward to Reference for MSVC

It compiles and runs ok but its disconcerting to see references to the
Borland header in the warning messages when compiling with VS.

ie c:\Dvl\Tools\loki\Borland\LokiTypeInfo.h(84) : warning C4800: 'int'
: forcing value to bool 'true' or 'false' (performance warning)

Is this an intentional or an oversight?

      [ See  http://www.**--****.com/ ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]

Similar Threads:

1.Loki::Factory and Loki::TList

Hi,

I read about the Loki::Factory and Loki::AbstractFactory in the book Modern
C++ Design and couldnt figure out one thing:
If I have several classes, for example the following hierarchie:

clase Base
{
    public:
        Base(Base* pBase) : _pBase(pBase) { }
    protected:
        Base* _pBase;
};

template<typename T, const T myT>
class Derived : public Base
{
    protected:
        T _t;
}

Now I define the following TList:
TYPELIST_3(Derived<int, 1>, Derived<string, "Hello">, Derived<int, 9>)
my_list;

And now I wanna create all the Objects in in the List connected in the chain
of responsibility, that means after the creation I wanna have the following
structure:
Derived<int, 1> --> Derived<string, "Hello"> --> Derived<int, 9> --> NULL
And the factory should return to me a pointer to the beginning so that means
to: Derived<int, 1>.

Ist such a behavior possible with the Loki::AbstractFactory or
Loki::Factory, or do I have to create my own?

Thanks in advance
Sebastian


2.Loki's Visitor and for_each

3.Loki's STATIC_CAST macro

In Chapter 2 of MC++D, Andrei Alexandrescu introduces a macro called
STATIC_CAST. Here is the source related to it:


#ifndef STATIC_CHECK_INC_
#define STATIC_CHECK_INC_

namespace Loki
{

    template<int> struct CompileTimeError;
    template<> struct CompileTimeError<true> {};
}

#define STATIC_CHECK(expr, msg) \
    { Loki::CompileTimeError<((expr) != 0)> ERROR_##msg; (void)ERROR_##msg; } 



#endif // STATIC_CHECK_INC_


I would be grateful if someone could explain to me the reason for the last line
of STATIC_CAST (the cast to void):
        (void)ERROR_##msg;

STATIC_CAST seems to be doing its job even without this line. So why is it
needed?

Cheers,
LRS

4.Loki's AbstractFactory and c-tor parameters

5.Loki's Factory.

6. Loki's AssocVector versus std::map in mt

7. About Loki's Functor and Sun CC

8. Loki's Factory Methods and Multithreading



Return to c++ moderated

 

Who is online

Users browsing this forum: No registered users and 41 guest