loki

How do I create an nullary Functor in C++ (using the loki library)

Writing something like this using the loki library, typedef Functor<void> BitButtonPushHandler; throws a compiler error, but this works typedef Functor<void,TYPELIST_1(Matrix3D*)> Perspective; Functor.h:530: error: '((Loki::FunctorHandler, int>)this)->Loki::FunctorHandler, int>::f' cannot be used as a function Functor.h:530: e...

Getting Loki Singleton to work in DLLs in VS 2008 C++

I'm pretty sure this problem isn't new, and pretty sure it's hard to solve. Hopefully I'm wrong about the latter. I'm trying to use the Loki::Singleton from Modern C++ Design in a program of mine. However, I can't seem to get it to work across DLLs. I think I know why this is happening: the templated code gets instantiated in every ...

Strange memory problem of Loki::Singleton, Loki::SmartPtr, and std::vector

I had encountered a problem while using Loki::Singleton, Loki::SmartPtr, and std::vector under VC express 2008. Following is my source. #include <iostream> #include <vector> #include <loki/Singleton.h> #include <loki/SmartPtr.h> class Foo { public: std::vector<Loki::SmartPtr<Foo>> children ; void add() { Loki::SmartP...

How do I use Loki's Small Object Allocator in Lua successfully?

I've read somewhere on here where someone recommended using Loki's Small Object Allocator for Lua to help improve allocation performance. I read through the section in 'Modern C++ Design' and I think I've got a good enough understand on using Loki for this, with the exception of not using the SmallObject - Lua just wants raw memory, so ...

How to use Loki's Pimpl implementation?

Link to source code of Loki Pimpl header. I am not able to find any documentation on how to use the same, can any one explain how to use. And what does the following function in the header do. PimplOwner ImplOf PimplOf RimplOf ...

Why is the Loki library not more widely used?

The Loki library implements some very widely used concepts (smart pointer, visitor, factory, etc.). The associated book "Modern C++ Design" is often mentioned, but the library itself is not widely used. Why is that? Most developers seem to prefer Boost. In particular, why do people often decide to use Boost's smart pointers rather than ...

Has the small object allocator found in "Modern C++ Design"/Loki been deprecated in favor of newer implementations?

It seems the code and the book have been relegated to the foundation of the movement of modern C++, and isn't updated any more. Is there some kind of replacement for this in Boost or TR1? ...

How do I use Loki's small object allocator?

I need to use Loki's small object allocator but I am very confused as to how it works. I've read the documentation and lots of forums but it doesnt make sense: some of them say to use the stl, others use custom allocators. I just need to be able to test its performance with allocating and deallocating objects of different sizes. Could so...

W3C, Google Gears and Loki Geolocation based on what?

Hi, I understand that these are client-side apps, but all three must be based on some component of the computer itself. Which component is this, and how can I utilize it programmatically for a C# app (NOT FOR WEB)? ...

C++: Are YOU using Loki or Boost for functors ?

Hi all, I've been reading Alexandrescu's book, Modern C++ design , and I've been quite impressed by the techniques he uses, so I wanted to add Loki library to my application. However, after further investigation, I saw that boost, that I'm already using, provides a lot of similar functionality (not all though, I couldn't find a singl...