#pragma once #include template static inline T to_neg_errno(const T rv_, const int errno_) { return ((rv_ == (T)-1) ? -errno_ : rv_); } template static inline T to_neg_errno(const T rv_) { return ::to_neg_errno(rv_,errno); }