summaryrefslogtreecommitdiffhomepage
path: root/example/asio_example_2/example.cpp
blob: 42410d7bbd8e0e1a66752d19d992da26830d23e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2026, Amlal El Mahrouss (amlal@nekernel.org)
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// Official repository: https://git.ocl.nekernel.org/core

#include <ocl/print.hpp>
#include <ocl/asio.hpp>
#include <ocl/allocator_op.hpp>
#include <future>
#include <boost/process.hpp>

namespace asio	  = ::boost::asio;
namespace process = ::boost::process;

/// @brief Wrap OCL in ASIO calls.
int main()
{
	asio::io_context ioc;
	process::process proc(ioc, "/usr/bin/g++", {"--version"}, process::v2::process_stdio{{/* in to default */}, {}, nullptr});

	proc.wait();

	ocl::asio::run<[]() { (void)0; }>(ioc);

	return EXIT_SUCCESS;
}