Skip to content

The process class is not default constructible as expected from documentation #562

Description

@sjoubert

Based on the current documentation and code comments (boost process v1.90) I was expecting the boost::process::v2::process class (aka basic_process) to be default contructible:

/** An empty process is similar to a default constructed thread. It holds an empty
handle and is a place holder for a process that is to be launched later. */
basic_process() = default;

However when trying to do that I get a compiler error (also see https://godbolt.org/z/nE93jvPqo):

<source>:4:33: error: call to implicitly-deleted default constructor of 'boost::process::v2::process' (aka 'basic_process<>')
    4 |     boost::process::v2::process p;
      |                                 ^
/app/boost/include/boost/process/v2/process.hpp:69:3: note: explicitly defaulted function was implicitly deleted here
   69 |   basic_process() = default;
      |   ^
/app/boost/include/boost/process/v2/process.hpp:340:34: note: default constructor of 'basic_process<>' is implicitly deleted because field 'process_handle_' has no default constructor
  340 |   basic_process_handle<Executor> process_handle_;
      |                                  ^
1 error generated.
Compiler returned: 1

Is the process class supposed to be default-constructible or not? If not the default constructor should probably be = delete instead of defaulted and the comment removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions