Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

My improvements based on an automated svn2git mirror of loki-lib. Warning: This means it gets rebased if there are upstream commits!

Notifications You must be signed in to change notification settings

rpavlik/loki-lib

 
 

Repository files navigation

The Loki Library

Loki is a C++ library of designs, containing flexible implementations of common design patterns and idioms. It was originally authored by Andrei Alexandrescu, to accompany his now well-known book "Modern C++ Design" (ISBN: 978-0-201-70431-0). It is distributed under the MIT license.

Latest "release" version: 0.1.7 (January 2009)

Directions

To use Loki, simply extract the files from the archive, give your compiler access to their include path:

  • if you have a standard conforming compiler use loki/include for #include <loki/HeaderFile.h> usage

  • if you have a non-conforming compiler (really, really old) use loki/include/noncc for #include <loki/HeaderFile.h> usage. The noncc files are declared as 'deprecated' and will be removed in future. They are also not updated with the new features of Loki and bugfixes (unless you do it and submit a pull request).

When you need to build a cpp source file

Much of Loki only needs header files. However, a few features require implementations found in .cpp source files, rather than inline in headers.

Add these source files to your project/makefile if your usage meets the corresponding description.

Note: Items marked with (?) might be too broad - that is, some uses in the description don't actually require the source file. If you can clarify any of these, please fork and pull request.

  • src/LevelMutex.cpp: if you use the <loki/LevelMutex.h> header.

  • src/OrderedStatic.cpp: if you use the <loki/OrderedStatic.h> header.

  • src/SafeFormat.cpp: if you use the <loki/SafeFormat.h> header. (?)

  • src/Singleton.cpp: if you use "Singletons with longevity"

  • src/SmallObj.cpp: If you use the small object allocator directly or indirectly. Indirect uses include:

    • The Functor class

    • The <loki/Allocator.h> header (?)

    • The <loki/SmartPtr.h> header (?)

    • Any Factory-related functionality (?)

  • src/SmartPtr.cpp: if you use the <loki/SmartPtr.h> header.

  • src/StrongPtr.cpp: if you use the <loki/StrongPtr.h> header.

Of course, you could also use the library generated by make.msvc.bat, make.mingw.bat, or make instead of adding those sources to your project.

Compatibility

Please do add to this list!

Most recently tested with:

(Git commit ID tested follows in parentheses.)

  • gcc version 4.4.3 on x86_64-linux-gnu (commit f1fb80a7d)
  • clang version 3.2 (trunk 164641) on x86_64-linux-gnu (commit f1fb80a7d)
  • Microsoft Visual C++ 2008 SP1 (commit b50a1c3bc)
  • Microsoft Visual C++ 2010 (commit b50a1c3bc)

Supported Compilers as of 2005

This was the previous compatibility list found in the README.

  • Gcc v3.4
  • Gcc v4.0
  • Gcc v4.1
  • Microsoft Visual C++ v7.1
  • Microsoft Visual C++ v8.0

by special noncc files:

  • Borland C++ Builder v6.0
  • Microsoft Visual C++ v6.0
  • Microsoft Visual C++ v7.0

see also readme.txt files

Mostly Supported:

  • CodeWarrior 6.0

CodeWarrior has a problem with the Conversion template (see TypeManip.h) and, though it compiles it, it doesn't provide correct results. Consequently, the DerivedToFront algorithm in Typelist.h does not function. This affects the static dispatcher in Multimethods.h. As a fix, you must order the types (putting the most derived ones in the front) when providing the typelist argument to StaticDispatcher.

More info

About

My improvements based on an automated svn2git mirror of loki-lib. Warning: This means it gets rebased if there are upstream commits!

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 74.9%
  • C 21.8%
  • Objective-C 3.3%