/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright 2011 Danny Robson */ #ifndef __UTIL_ANNOTATION_HPP #define __UTIL_ANNOTATION_HPP template constexpr inline bool likely (T &&t) { return __builtin_expect (!!t, true); } template constexpr inline bool unlikely (T &&t) { return __builtin_expect (!!t, false); } constexpr inline long expect (long val, long typical) { return __builtin_expect (val, typical); } #endif