The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

siebevos (1) [Avatar] Offline
#1
Hi Jay,

How can I make a function private within a class, while this function is shared by other functions in the class that are public. I haven't seen any samples of this in chapter 16 or 17. Or is this outside the scope of the book?

Thanks!

Bye,

Siebe Vos
jesus.garcia (463) [Avatar] Offline
#2
Re: Using private functions within a class
It's called a "Closure".

Here's a pattern that I would recommend: http://www.extpaste.com/#3129
jesus.garcia (463) [Avatar] Offline
#3
Re: Using private functions within a class
Siebe,

It's beyond the scope of the book, but here is a quick intro to your answer.

http://www.extpaste.com/#3129