diff libinterp/octave-value/cdef-property.h @ 27187:42efd1e986c7

declare classdef property get methods const * cdef-property.h, cdef-property.cc (classdef_property::get, classdef_property::classdef_property_rep::get): Declare const. (classdef_property::classdef_property_rep::err_property_access): Now a const method instead of a file-scope static function. Change all uses.
author John W. Eaton <jwe@octave.org>
date Fri, 14 Jun 2019 15:32:50 -0500
parents 396d17dcfb9f
children b442ec6dda5c
line wrap: on
line diff
--- a/libinterp/octave-value/cdef-property.h	Fri Jun 14 12:52:27 2019 -0500
+++ b/libinterp/octave-value/cdef-property.h	Fri Jun 14 15:32:50 2019 -0500
@@ -69,11 +69,11 @@
       bool is_constant (void) const { return get("Constant").bool_value (); }
 
       octave_value get_value (bool do_check_access = true,
-                              const std::string& who = "");
+                              const std::string& who = "") const;
 
       octave_value get_value (const cdef_object& obj,
                               bool do_check_access = true,
-                              const std::string& who = "");
+                              const std::string& who = "") const;
 
       void set_value (cdef_object& obj, const octave_value& val,
                       bool do_check_access = true,
@@ -95,6 +95,10 @@
         m_count++;
         return cdef_property (this);
       }
+
+      OCTAVE_NORETURN
+      void err_property_access (const std::string& from,
+                                bool is_set = false) const;
     };
 
   public:
@@ -128,13 +132,13 @@
     ~cdef_property (void) = default;
 
     octave_value get_value (const cdef_object& obj, bool do_check_access = true,
-                            const std::string& who = "")
+                            const std::string& who = "") const
     {
       return get_rep ()->get_value (obj, do_check_access, who);
     }
 
     octave_value get_value (bool do_check_access = true,
-                            const std::string& who = "")
+                            const std::string& who = "") const
     {
       return get_rep ()->get_value (do_check_access, who);
     }