LayerResult's second field is typed size_t, so std::numeric_limits::max should also use size_t and not something related to coordinates for the layer_id.