octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #51801] OO: constructor without arguments


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #51801] OO: constructor without arguments
Date: Mon, 21 Aug 2017 16:05:16 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Update of bug #51801 (project octave):

                Severity:              3 - Normal => 2 - Minor              
              Item Group:                    None => Documentation          
                  Status:                    None => Need Info              

    _______________________________________________________

Follow-up Comment #2:

Even for a classdef class, a user may choose to not allow construction of an
object without any arguments if they want to, there is nothing wrong with
that.

For example


classdef myclass < handle
  properties
    value
  endproperties
  methods
    function self = myclass (value)
      if (nargin < 1)
        error ("myclass: VALUE argument is required");
      endif
      self.value = value;
    endfunction
  endmethods
endclassdef

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51801>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]