// file : bpkg/satisfaction -*- C++ -*- // copyright : Copyright (c) 2014-2016 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file #ifndef BPKG_SATISFACTION #define BPKG_SATISFACTION #include #include #include namespace bpkg { // Return true if version satisfies the constraint. // bool satisfies (const version&, const dependency_constraint&); inline bool satisfies (const version& v, const optional& c) { return !c || satisfies (v, *c); } // Return true if any version that satisfies l also satisfies r, or, in // other words, l is stricter than or equal to r. Or, in yet other words, // l is a subset of r. // bool satisfies (const dependency_constraint& l, const dependency_constraint& r); inline bool satisfies (const optional& l, const optional& r) { return l ? (!r || satisfies (*l, *r)) : !r; } } #endif // BPKG_SATISFACTION