More grammar work, all idl files are now parsed entirely again.
[fail.git] / src / core / overload.h
blob30bc7b81f2c165301cb13520d0e4dcda39796bf2
1 /*
2 Fail game engine
3 Copyright 2007 Antoine Chavasse <a.chavasse@gmail.com>
5 This file is part of Fail.
7 Fail is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 3
9 as published by the Free Software Foundation.
11 Fail is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef FAIL_OVERLOAD_H_
20 #define FAIL_OVERLOAD_H_
22 namespace fail
24 template< class CC, int SplitValue, class L, class R > struct OvlCountRes
26 static bool Call( CC& CallContext_ )
28 if( CallContext_.numParams() > SplitValue )
29 return R::Call( CallContext_ );
30 else
31 return L::Call( CallContext_ );
35 template< class CC, class TRY, class ELSE > struct OvlTypeRes
37 static bool Call( CC& CallContext_ )
39 if( TRY::Call( CallContext_ ) )
40 return true;
41 else
42 return ELSE::Call( CallContext_ );
47 #endif