Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#304 closed defect (fixed)

Noncopyable types do explicitly block copying operations

Reported by: mloskot Owned by: mloskot
Priority: major Milestone:
Component: Core Version: main
Severity: Significant Keywords:
Cc:

Description

At large, GEOS types which mostly are not copy constructible, do not block copy operations explicitly. A compiler is free to generate implicit ones which by default are public. It mismatches noncopyable contract with actual type implementation.

In order to fix it, declare (not define) private assignment operator and copy constructor.

Change History (3)

comment:1 by mloskot, 14 years ago

Status: newassigned

comment:2 by mloskot, 14 years ago

Resolution: fixed
Status: assignedclosed

Fixed in trunk in ~30 commits from r2759 to r2789 along with other minor improvements. (Commits in chunks to not to kill OSGeo Trac server.)

  • Compilation and tests run using Visual C++ 9.0 and GCC 4.4.1
  • This fixes clean more than 2000 warnings thrown by Visual C++ 8.0+
  • Compilation now gives no GEOS specific warnings
  • Number of Windows/Visual C++/STL/DLL specific ones - C4251:
     warning C4251: 'geos::geom::Point::coordinates' : 
       class 'std::auto_ptr<_Ty>' needs to have dll-interface to be used by
          clients of class 'geos::geom::Point'
    

If anything got broken here, please reopen.

comment:3 by mloskot, 14 years ago

The changeset r2790 confirmed as no warnings snapshot using:

  • GCC 4.4.1 (-pedantic -ansi -Wall --Wno-long-long)
  • Visual C++ 9.0 (with /W4 level)
Note: See TracTickets for help on using tickets.