Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
void updateFilter(bool bRecalc = true);
No permission to create posts
September 11, 2013
4:47 am
Avatar
mgill404
Member
Members
Forum Posts: 13
Member Since:
August 27, 2013
sp_UserOfflineSmall Offline

Here's the line of code I'm having issues understanding.

void updateFilter(bool bRecalc = true);

We have a prototype here that has been placed in my main header file. What is the purpose of setting bRecalc within this declaration? I would expect this to look like:

void updateFilter(bool bRecalc);

Thanks for the help.

September 11, 2013
5:05 am
Avatar
mgill404
Member
Members
Forum Posts: 13
Member Since:
August 27, 2013
sp_UserOfflineSmall Offline

My best guess is that it allows for the function call to have no value passed to it, and the default value will be true.

September 11, 2013
7:26 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
sp_UserOnlineSmall Online

Yes, that sets the default behavior so updateFilter() does the same thing as updateFilter(true). There are restrictions when you do this with multiple arguments (the ones with defaults have to be at the end of the list).

See also:

http://www.cplusplus.com/forum.....eral/5098/

- Will

Forum Timezone: America/New_York

Most Users Ever Online: 36

Currently Online: W Pirkle
3 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 47

Peter: 41

Derek: 41

clau_ste: 39

Frodson: 38

Gwen: 32

EZB: 24

lppier: 23

Msaldaña: 18

Jorge: 17

Member Stats:

Guest Posters: 1

Members: 476

Moderators: 1

Admins: 4

Forum Stats:

Groups: 11

Forums: 30

Topics: 482

Posts: 1876

Newest Members:

sam, annaharris, Marie Weaver, kev, Steven, Mr Anderson, mguy, omelc

Moderators: W Pirkle: 143

Administrators: Tom: 65, JD Young: 80, Will Pirkle: 0, W Pirkle: 143