Changeset 92:77b2d68da1f5 in rrlib_util


Ignore:
Timestamp:
05.09.2013 15:41:14 (6 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
default
Phase:
public
Message:

Replaced std::function in ProcessVariadicValues by less restricitve template parameter to get more performance out of this pattern

File:
1 edited

Legend:

Unmodified
Added
Removed
  • variadic_templates.h

    r80 r92  
    6464//---------------------------------------------------------------------- 
    6565 
    66 template <typename TElement> 
    67 inline void ProcessVariadicValues(std::function<void(const TElement &)> process_value) 
     66template <typename TProcessor> 
     67inline void ProcessVariadicValues(const TProcessor &process_value) 
    6868{} 
    6969 
    70 template <typename TElement, typename THead, typename ... TTail> 
    71 //inline void ProcessVariadicValues(const THead &head, const TTail &... tail, std::function<void(const THead &)> process_value) FIXME: will probably be valid with gcc 4.6 and does not need hints at instantiation 
    72 inline void ProcessVariadicValues(std::function<void(const TElement &)> process_value, const THead &head, const TTail &... tail) 
     70template <typename TProcessor, typename THead, typename ... TTail> 
     71inline void ProcessVariadicValues(const TProcessor &process_value, const THead &head, const TTail &... tail) 
    7372{ 
    7473  process_value(head); 
Note: See TracChangeset for help on using the changeset viewer.