Changeset 77:bedaa523bcc0 in finroc_plugins_data_ports


Ignore:
Timestamp:
30.07.2014 15:06:33 (5 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
default
Phase:
public
Message:

Made constructor of tBound work with arbitrary arguments that are convertable to internal type

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tBounds.h

    r63 r77  
    9595   * \param out_of_bounds_action How to proceed if an incoming value is out of bounds 
    9696   */ 
    97   tBounds(T min, T max, tOutOfBoundsAction out_of_bounds_action = tOutOfBoundsAction::ADJUST_TO_RANGE) : 
     97  template <typename TMin, typename TMax> 
     98  tBounds(TMin min, TMax max, tOutOfBoundsAction out_of_bounds_action = tOutOfBoundsAction::ADJUST_TO_RANGE) : 
    9899    min(min), max(max), 
    99100    action(out_of_bounds_action), 
     
    108109   * \param out_of_bounds_default Default value to apply when value is out of bounds 
    109110   */ 
    110   tBounds(T min, T max, T out_of_bounds_default) : 
     111  template <typename TMin, typename TMax> 
     112  tBounds(TMin min, TMax max, T out_of_bounds_default) : 
    111113    min(min), max(max), 
    112114    action(tOutOfBoundsAction::APPLY_DEFAULT), 
Note: See TracChangeset for help on using the changeset viewer.