mesos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Mahler <>
Date Tue, 10 Apr 2018 21:20:21 GMT
Just an FYI about some recently added CHECKs that make some minor changes
to the way we write code:


Much like glog's CHECK_NOTNULL, sometimes you know from invariants that an
Option cannot be in the none state and you want to "de-reference" it
without writing logic to handle the none case:

Option<T> func(...);
T t = CHECK_NOTNULL(func(...));

Option<T> some_option = ...;
T t = CHECK_NOTNONE(std::move(some_option));

Our existing code tends to use unguarded .get() calls, so hopefully this
new pattern makes it clearer when we're assuming an option is in the some


This is the same, but for Try:

Try<T> func(...);
T t = CHECK_NOTERROR(func(...));

Try<T> some_try = ...;
T t = CHECK_NOTERROR(std::move(some_try));

You can find them here:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message