I was searching for reasons that prevent my compiler (intel 15) to vectorize my code. The reasons were : loop with early exits cannot be vectorized unless it meets search loop idiom criteria
although I did not have any thing like break
or exit(0)
in it.
So I checked all my function with the noexcept
operator and it seems that all my template function are likely to throw exception (the operator returns false all the time) althgough I have no try/catch/throw in it.
For this reason, I specify the noexcept
on my function and now it works but I don't understand why the compiler say that they are likely to throw something ? How can I specify that, by default, they won't throw anything ??
Example:
/*.h*/
template <typename T>
void A(T& a){} /*does nothing*/
/*.cpp*/
#include ".h"
#include "MyClass.h"
int main(){
MyClass C;
noexcept(A(C)); /*Return false !!*/
}
Thanks.