I'm not sure how to phrase this or what it's actually called, but I know that in Objective-C you can have multiple constructors that can successively call one another, forgive any code erros, I haven't done this in a while, but the idea is there.
- (id)initWithTitle:(NSString *)_title;
- (id)initWithTitle:(NSString *)_title page:(NSString *)_page;
-----------------------------------
- (id)initWithTitle:(NSString *)_title {
return [self initWithTitle:_title page:nil];
}
- (id)initWithTitle:(NSString *)_title page:(NSString *)_page {
if(self = [super init]) {
self.title = _title;
self.page = _page;
}
return self;
}
I'm just wondering if there is an equivalent of this in c++;