The following gets a compiler warning C4838: conversion from 'int' to 'std::size_t' requires a narrowing conversion.
size_t firstNonZero[2] = { -1, -1 };
but if I explicitly cast the values to size_t, the error goes away.
size_t firstNonZero[2] = { static_cast<size_t>(-1), static_cast<size_t>(-1) };
Why is a narrowing conversion required? In other words, why is -1 not coercible to size_t without any possible data loss?