template <class Decorated, class TList, bool isDynamic = false>
class DecorateClass;
template <class Decorated, class Head>
class DecorateClass<Decorated, Typelist<Head, NullType>, false>
{
public:
static Head *Decorate() { return new Head(new Decorated); }
};
template <class Decorated, class Head, class Tail>
class DecorateClass<Decorated, Typelist<Head, Tail>, false>
{
public:
static Head *Decorate() { return new Head(DecorateClass<Decorated, Tail>::Decorate()); }
};
For now there is only the static implementation for it.
When I will have time I'll make the dynamic one.
Omer
Hi, can someone write a test case for this?
Alternatively can someone please explain how should I wrtie a test case?
Hi Omer,
It seems that by assigning this feature request to me, you would like me to write the tests for it. Thanks for the endorsement, but I encourage people who contribute to Loki to write their own unit tests. (Hint: Please don't make a feature request and assign it to somebody without checking with them first.)
In order to add your Decorator implementation to Loki, I'd like to see documentation comments, unit tests, and usage cases.
If you need help writing a test case, then I suggest you start with some real world uses of this Decorator implementation. Do you have some real world uses that you can adapt into test cases?
If you're asking how to create a test project, like the test projects for various parts of Loki, then I suggest looking at many of the test projects which come with Loki. You can use one or more of those as an example for creating your own.
I hope that answers your questions. If not, please clarify.
Cheers,
Rich
test case main.cpp
test case here :)
File Added: main.cpp
test case Decorator.hpp
File Added: Decorator.hpp