Main Content

clibIsReadOnly

Determine if C++ object is read-only

Description

tf = clibIsReadOnly(cppObj) returns logical 1 (true) if cppObj is read-only. Otherwise, it returns logical 0 (false).

example

Examples

collapse all

Suppose that you have a MATLAB® interface to this C++ library MyClass:

const class MyClass 
{ 
    public: 
        int val1; 
        int val2; 
}; 
 
const MyClass& func(); 

Call the function func in MATLAB to create a const MyClass object:

res = clib.MyClass.func()
res =  
 read-only MyClass with properties: 
  val1: 1 
  val2: 2

Verify that the object is read-only:

clibIsReadOnly(res)
ans = 
  logical   
   1

The function returns logical 1 (true) meaning the object is read-only.

Input Arguments

collapse all

C++ object created in MATLAB, specified as a handle

Version History

Introduced in R2019b