]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/safe_numerics/example/example17.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / safe_numerics / example / example17.cpp
1 #include <boost/safe_numerics/safe_integer.hpp>
2 using namespace boost::safe_numerics;
3
4 int f(int i){
5 return i;
6 }
7
8 using safe_t = safe<long, native, loose_trap_policy>;
9
10 int main(){
11 const long x = 97;
12 f(x); // OK - implicit conversion to int
13 const safe_t y = 97;
14 f(y); // Would be OK, but will invoke compile time error
15 return 0;
16 }