chr1shr / voro

Voro++: a three-dimensional Voronoi cell library in C++
Other
154 stars 44 forks source link

voronoicell(_neighbor) is not copy-constructable #6

Open tohain opened 3 years ago

tohain commented 3 years ago

The classes voronoicell and voronoicell_neighbor are not copy-constructable. Thus code, where such objects are returned bail out at compilation (g++-10) with the error:

In file included from /voro++.hh:322,
                 from main.cpp:1:
voro++/cell.hh: In instantiation of ‘voro::voronoicell::voronoicell(c_class&) [with c_class = voro::voronoicell]’:
main.cpp:13:31:   required from here
voro++/cell.hh:323:52: error: ‘class voro::voronoicell’ has no member named ‘max_len_sq’
  323 |   voronoicell(c_class &con) : voronoicell_base(con.max_len_sq) {}
      |                                                ~~~~^~~~~~~~~~

with the minimal example

#include "voro++.hh"

int main(){
  voro::container_periodic_poly con (1, 0,1,0,0,1, 8, 8, 8, 8);
  voro::voronoicell vc;
  voro::particle_order po;

  con.put( po, 0, 0.1, 0.1, 0.1, 1 );
  con.compute_cell(vc, po.o[0], po.op[0] );

  voro::voronoicell vc_c ( vc );
}