Search
 
SCRIPT & CODE EXAMPLE
 

CPP

cpp mark getter as const

// Return a constant bool. One that cannot change values once it's created
const bool isReady() {
    return ready;
}

// A constant function. One that will not change any mmeber variables of the class it belongs to
// This is the style recommended to use for getters,
// 	since their only purpose is to retrieve data and should not modify anything in the process.
bool getReady() const { 
    return ready;
}

Comment

PREVIOUS NEXT
Code Example
Cpp :: how to find min of two numbers in c++ 
Cpp :: unordered_set to vector 
Cpp :: integer range in c++ 
Cpp :: remove element from vector c++ 
Cpp :: c++ map insert 
Cpp :: c++ string find example 
Cpp :: c++ do every 1 minutes 
Cpp :: iterate over map c++ 
Cpp :: c++ open file explorer 
Cpp :: insertion sort cpp 
Cpp :: iterate vector c++ 
Cpp :: what is meant by pragma once in c++ 
Cpp :: c++ thread 
Cpp :: cuda shared variable 
Cpp :: how to remove first element from vector c++ 
Cpp :: print hello world c++ 
Cpp :: c++ get whole line 
Cpp :: structure of a function in C++ 
Cpp :: find function in c++ 
Cpp :: c++ math 
Cpp :: pass map as reference c++ 
Cpp :: how to make dictionary of numbers in c++ 
Cpp :: friend function in c++ 
Cpp :: resharper fold if statement c+ 
Cpp :: initialize 2d vector c++ 
Cpp :: what is the meaning of life and everything in the universe 
Cpp :: how to make randomizer c++ 
Cpp :: std::map get all keys 
Cpp :: ifstream 
Cpp :: hello world programming 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =