COIN-OR::LEMON - Graph Library

Opened 16 years ago

Closed 16 years ago

#116 closed defect (fixed)

ArgParser should be cleaned

Reported by: Balazs Dezso Owned by: Alpar Juttner
Priority: major Milestone: LEMON 1.0 release
Component: core Version: hg main
Keywords: Cc:
Revision id:

Description

There are some public member functions which takes to iterators, which iterators should be refer to a private container. These member functions should be private in these class.

In addition, some member function should be const. For example files(), showHelp(), given(), operator[]()...

Attachments (1)

60eecd3fe37a.patch (9.3 KB) - added by Alpar Juttner 16 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 16 years ago by Alpar Juttner

Version: hg main

Changed 16 years ago by Alpar Juttner

Attachment: 60eecd3fe37a.patch added

comment:2 Changed 16 years ago by Alpar Juttner

Status: newassigned

The const specifier was invented directly by the Evil. The more I must use it, the more I hate it.

Anyway, [60eecd3fe37a] is an attempt to solve the problems indicated in the ticket. How do you like it?

comment:3 in reply to:  2 ; Changed 16 years ago by Balazs Dezso

Replying to alpar:

The const specifier was invented directly by the Evil. The more I must use it, the more I hate it.

Maybe Stroutstup is the Evil... However, I thought that the const come from C, but I should realize that it is a real C++ feature, and the C just acquired from C++.

Anyway, [60eecd3fe37a] is an attempt to solve the problems indicated in the ticket. How do you like it?

In my opinion, the patch can close the ticket.

comment:4 in reply to:  2 Changed 16 years ago by Peter Kovacs

Replying to alpar:

Anyway, [60eecd3fe37a] is an attempt to solve the problems indicated in the ticket. How do you like it?

I think it's okay.

comment:5 in reply to:  3 Changed 16 years ago by Alpar Juttner

Replying to deba:

Replying to alpar:

The const specifier was invented directly by the Evil. The more I must use it, the more I hate it.

Maybe Stroutstup is the Evil... However, I thought that the const come from C, but I should realize that it is a real C++ feature, and the C just acquired from C++.

It is not true. At least it I'm sure there is not a single word about const in the Kernighan-Ritchie book. Moreover the very first hit for "const in c" in google says

"idea of const has been borrowed from C++"

On the other hand, the concept of const becomes complete (I mean completely stupid and annoying) with the const functions and const_iterators, which are missing from C.

Anyway, my major problem is not that the const is completely useless for preventing bugs, but the fact that placing a single const somewhere makes it necessary to put new const specifiers everywhere in the code. If the compiler is clever enough to make a conclusion that a function declared const attempts to change something, why it cannot notice if a function without a const specifier does not modify anything?

comment:6 Changed 16 years ago by Alpar Juttner

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.