class Parallelstl < Formula desc "C++ standard library algorithms with support for execution policies" homepage "https://github.com/intel/parallelstl" url "https://github.com/intel/parallelstl/archive/20190305.tar.gz" sha256 "a107a53ee7aeb9c456efb882a99c1df2b1a121e28779ed399a0711776c4807d3" bottle :unneeded depends_on "tbb" def install include.install Dir["include/*"] end test do (testpath/"test.cpp").write <<~EOS #include #include #include #include int main() { std::array arr {{5,2,3,1,4,9,7,0,8,6}}; std::sort(std::execution::par_unseq, arr.begin(), arr.end()); for(int i=0; i<10; i++) assert(i==arr.at(i)); return 0; } EOS system ENV.cxx, "-std=c++11", "-L#{Formula["tbb"].opt_lib}", "-ltbb", "-I#{include}", "test.cpp", "-o", "test" system "./test" end end