Commit f604e8f2 authored by Martin Heistermann's avatar Martin Heistermann

silence vector11T cppcheck false positives

parent d0a6a93b
......@@ -20,7 +20,7 @@ echo -e "${NC}"
echo "Please Wait ..."
# Run cppcheck and output into file
cppcheck --enable=all . -I src -i Doc/ --force --suppress=missingIncludeSystem --quiet -Umin -Umax -UBMPOSTFIX -DOPENVOLUMEMESHDLLEXPORT="" 2>&1 | tee cppcheck.log
cppcheck --enable=all . -I src -i Doc/ --force --suppress=missingIncludeSystem --inline-suppr --quiet -Umin -Umax -UBMPOSTFIX -DOPENVOLUMEMESHDLLEXPORT="" 2>&1 | tee cppcheck.log
COUNT=$(wc -l < cppcheck.log )
......
......@@ -121,7 +121,9 @@ class VectorT {
typename = typename std::enable_if<sizeof...(T) == DIM>::type,
typename = typename std::enable_if<
are_convertible_to<Scalar, T...>::value>::type>
constexpr VectorT(T... vs) : values_ { {static_cast<Scalar>(vs)...} } {
// cppcheck-suppress noExplicitConstructor ; only applies to unimportant DIM==1
constexpr VectorT(T... vs) : values_ { {static_cast<Scalar>(vs)...} }
{
static_assert(sizeof...(T) == DIM,
"Invalid number of components specified in constructor.");
static_assert(are_convertible_to<Scalar, T...>::value,
......@@ -176,7 +178,9 @@ class VectorT {
template<typename OtherScalar,
typename = typename std::enable_if<
std::is_convertible<OtherScalar, Scalar>::value>>
vector_type& operator=(const VectorT<OtherScalar, DIM>& _rhs) {
// cppcheck-suppress operatorEqRetRefThis ; false positive
vector_type& operator=(const VectorT<OtherScalar, DIM>& _rhs)
{
std::transform(_rhs.data(), _rhs.data() + DIM,
data(), [](OtherScalar rhs) {
return static_cast<Scalar>(std::move(rhs));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment