MantisBT - VTK | |||||
| View Issue Details | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0007192 | VTK | (No Category) | public | 2008-06-14 17:43 | 2016-08-12 09:54 |
| Reporter | Tom Fogal | ||||
| Assigned To | Kitware Robot | ||||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | moved | ||
| Platform | OS | OS Version | |||
| Product Version | |||||
| Target Version | Fixed in Version | ||||
| Project | |||||
| Type | |||||
| Summary | 0007192: Read-only access to objects is not const correct | ||||
| Description | Accessing data within a VTK object is a mutable operation, even when the data access itself does not actually mutate the object's state. This imposes difficulties when using VTK in a const-correct environment. | ||||
| Steps To Reproduce | |||||
| Additional Information | Attached is a small patch aimed at allowing easier use of VTK in a const correct program. The current definition of vtkGetObjectMacro essentially expands into: virtual type *GetWhateverYouSay() { ... } This causes the macro to expand into: virtual type *GetWhateverYouSay() { ... } virtual const type *GetWhateverYouSay() const { ... } As it provides both versions, it provides a backwards-compatible API while allowing new code to utilize the const correct version. The change to vtkObject was necessary to get the build to work; I made the `GetDebug' method const. Would you accept more patches of this nature? | ||||
| Tags | No tags attached. | ||||
| Relationships | |||||
| Attached Files | https://www.vtk.org/Bug/file/6529/const.patch | ||||
| Issue History | |||||
| Date Modified | Username | Field | Change | ||
| 2008-06-14 17:43 | Tom Fogal | New Issue | |||
| 2008-06-14 17:43 | Tom Fogal | File Added: const.patch | |||
| 2008-06-14 19:16 | Tom Fogal | Note Added: 0012344 | |||
| 2011-06-16 13:11 | Zack Galbreath | Category | => (No Category) | ||
| 2016-08-12 09:54 | Kitware Robot | Note Added: 0036988 | |||
| 2016-08-12 09:54 | Kitware Robot | Status | expired => closed | ||
| 2016-08-12 09:54 | Kitware Robot | Resolution | open => moved | ||
| 2016-08-12 09:54 | Kitware Robot | Assigned To | => Kitware Robot | ||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||