Skip to content

Calling induce() from cppyy reports an error but actually works #159

@saraedum

Description

@saraedum

The first time we call induce() on an IET, cppyy reports something like this:

input_line_41:3:40: error: cannot initialize a member subobject of type 'intervalxt::InductionStep::Result' with an lvalue of type 'const int'
  self = new intervalxt::InductionStep{result, connection, additionalIntervalExchangeTransformation};
                                       ^~~~~~
input_line_41:3:60: error: call to implicitly-deleted copy constructor of 'std::optional<IntervalExchangeTransformation>'
  self = new intervalxt::InductionStep{result, connection, additionalIntervalExchangeTransformation};
                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jule/proj/conda/miniconda3/envs/flatsurf/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/include/c++/9.3.0/optional:658:7: note: copy constructor of 'optional<intervalxt::IntervalExchangeTransformation>' is implicitly deleted because base class
      '_Enable_copy_move<is_copy_constructible_v<intervalxt::IntervalExchangeTransformation>,
      __and_v<is_copy_constructible<intervalxt::IntervalExchangeTransformation>, is_copy_assignable<intervalxt::IntervalExchangeTransformation> >,
      is_move_constructible_v<intervalxt::IntervalExchangeTransformation>, __and_v<is_move_constructible<intervalxt::IntervalExchangeTransformation>,
      is_move_assignable<intervalxt::IntervalExchangeTransformation> >, optional<intervalxt::IntervalExchangeTransformation> >' has a deleted copy constructor
      private _Enable_copy_move<
      ^
/home/jule/proj/conda/miniconda3/envs/flatsurf/bin/../lib/gcc/x86_64-conda-linux-gnu/9.3.0/../../../../x86_64-conda-linux-gnu/include/c++/9.3.0/bits/enable_special_members.h:157:15: note: '_Enable_copy_move' has been explicitly marked deleted here
    constexpr _Enable_copy_move(_Enable_copy_move const&) noexcept  = delete;

This is https://bitbucket.org/wlav/cppyy/issues/305/initialization-of-struct-reports-an-error. We could work around by creating a constructor it seems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpython

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions