//********************************************************
// The following code example is taken from the book
//  C++23 - The Complete Guide
//  by Nicolai M. Josuttis (www.josuttis.com)
//  https://www.cppstd23.com
//
// The code is licensed under a
//  Creative Commons Attribution 4.0 International License
//  https://creativecommons.org/licenses/by/4.0/
//********************************************************


#include <print>
#include <vector>
#include <array>
#include <algorithm>

int main()
{
  std::vector<int> coll{0, 8, 44, 0, 8, 15, 7};

  // check whether the range contains a specific value:
  auto val = 42;
  std::println("{} contains {:<10}: {}", coll, val, 
                                         std::ranges::contains(coll, val));

  // check whether the range contains a specific sub-sequence:
  std::array sub{0, 8, 15};
  std::println("{} contains {:<10}: {}",
               coll, sub, 
               std::ranges::contains_subrange(coll, sub));
}

