no message
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@115 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
b87a77764d
commit
47c00f6ee0
1 changed files with 52 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
Loki VC 6.0 Port or how to produce C1001 - Internal Compiler Errors
|
Loki VC 6.0 Port or how to produce C1001 - Internal Compiler Errors
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Version: 0.5
|
Version: 0.5a
|
||||||
|
|
||||||
Introduction/Compatibility:
|
Introduction/Compatibility:
|
||||||
---------------------------
|
---------------------------
|
||||||
|
@ -30,7 +30,16 @@ If you use Singletons with longevity you must add Singleton.cpp to your project/
|
||||||
Fixes:
|
Fixes:
|
||||||
------
|
------
|
||||||
|
|
||||||
Feb 2003:
|
Mar 08, 2003:
|
||||||
|
-------------
|
||||||
|
* In SmartPointer.h: Added helper-macros for convenient specialization
|
||||||
|
of std::less for Smart-Pointers.
|
||||||
|
|
||||||
|
* I found a way to use void as a default value for template parameters.
|
||||||
|
Therefore I changed MultiMethods.h and Visitor.h accordingly.
|
||||||
|
|
||||||
|
|
||||||
|
Feb 2003:
|
||||||
---------
|
---------
|
||||||
* created new versions of Functor.h, Visitor.h and MultiMethods.h that
|
* created new versions of Functor.h, Visitor.h and MultiMethods.h that
|
||||||
now can handle void return types transparently.
|
now can handle void return types transparently.
|
||||||
|
@ -175,8 +184,25 @@ Unfortunately the MSVC 6.0 supports neither of them.
|
||||||
in the original library were changed so that they have exactly the
|
in the original library were changed so that they have exactly the
|
||||||
same return type as the original virtual function (e.g. return a pointer to Base).
|
same return type as the original virtual function (e.g. return a pointer to Base).
|
||||||
|
|
||||||
E. All template parameters that have a default type of void in the original lib now
|
E. The MSVC 6.0 does not allow code like this:
|
||||||
have int as default type.
|
[code]
|
||||||
|
// error C2182: '__formal' illegal use of type 'void'
|
||||||
|
template <class T, class R = void>
|
||||||
|
struct Blub {};
|
||||||
|
[/code]
|
||||||
|
|
||||||
|
Interestingly enough you can have void as default type by simply using another
|
||||||
|
level of indirection:
|
||||||
|
[code]
|
||||||
|
struct VoidWrap
|
||||||
|
{
|
||||||
|
typedef void type;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <class T, class R = VoidWrap::type>
|
||||||
|
struct Blub
|
||||||
|
{};
|
||||||
|
[/code]
|
||||||
|
|
||||||
F. To workaround void returns I did the following:
|
F. To workaround void returns I did the following:
|
||||||
From every original class I moved those functions that potentially
|
From every original class I moved those functions that potentially
|
||||||
|
@ -403,6 +429,28 @@ Interface changes:
|
||||||
|
|
||||||
* This port does not specialize std::less
|
* This port does not specialize std::less
|
||||||
|
|
||||||
|
Update:
|
||||||
|
-------
|
||||||
|
The port provides some helper-macros for convenient specialization
|
||||||
|
of std::less for Smart-Pointers.
|
||||||
|
|
||||||
|
If, for example, you want to use a Smart-Pointer as the key of a std::map,
|
||||||
|
you can do it like this:
|
||||||
|
[code]
|
||||||
|
#include <map>
|
||||||
|
#include <loki/SmartPtr.h>
|
||||||
|
|
||||||
|
SMARTPTR_SPECIALIZE_LESS(Apple)
|
||||||
|
|
||||||
|
class Apple {};
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
std::map<SmartPointer<Apple>, int> m;
|
||||||
|
//...
|
||||||
|
}
|
||||||
|
[/code]
|
||||||
|
|
||||||
9. Visitor.h
|
9. Visitor.h
|
||||||
|
|
||||||
* no template template parameters
|
* no template template parameters
|
||||||
|
|
Loading…
Reference in a new issue