Correct force inline syntax for IAR compiler

Unlinke other compilers supported, the IAR compiler requires the
pre-processor extension to force inline a method to be placed before
the keyword `template` if the method is declared with one.
pull/11523/head
Hugues Kamba 2019-09-19 10:52:02 +01:00
parent 4f7339af78
commit e2aeb601f1
1 changed files with 6 additions and 2 deletions

View File

@ -83,8 +83,12 @@ public:
* @param func pointer to the function to be called
* @param t the time between calls in seconds
*/
template <typename F>
MBED_FORCEINLINE void attach(F &&func, float t)
#if defined(__ICCARM__)
MBED_FORCEINLINE template <typename F>
#else
template <typename F> MBED_FORCEINLINE
#endif
void attach(F &&func, float t)
{
attach_us(std::forward<F>(func), t * 1000000.0f);
}