Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
visitor-policies.hpp
Go to the documentation of this file.
1/*
2 VISITOR-POLICIES.hpp - Acyclic Visitor library
3
4 Copyright (C)
5 2008, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12*/
13
14
23#ifndef LUMIERA_VISITOR_POLICIES_H
24#define LUMIERA_VISITOR_POLICIES_H
25
26#include "lib/error.hpp"
27
28
29namespace lib {
30namespace visitor {
31
37 template<class RET>
39 {
40 template<class TAR>
41 RET
42 onUnknown (TAR&)
43 {
44 return RET();
45 }
46 };
47
51 template<class RET>
53 {
54 template<class TAR>
55 RET
56 onUnknown (TAR&)
57 {
58 throw lumiera::error::Config("unable to decide what tool operation to call");
59 }
60 };
61
62
63
64}} // namespace lib::visitor
65#endif
Lumiera error handling (C++ interface).
Implementation namespace for support and library code.
LumieraError< LERR_(CONFIG), Invalid > Config
Definition error.hpp:212
Policy to throw when encountering an unknown visiting tool.
Policy returning just the default return value in case of encountering an unknown Visitor (typically ...