Click here to Skip to main content
15,921,941 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionAbout OnFilePrint and OnPreparePrinting question. Pin
wangningyu11-Jun-10 21:53
wangningyu11-Jun-10 21:53 
QuestionTemplated array in class Pin
grusky11-Jun-10 14:27
grusky11-Jun-10 14:27 
AnswerRe: Templated array in class Pin
Rick York11-Jun-10 15:46
mveRick York11-Jun-10 15:46 
AnswerRe: Templated array in class Pin
Nemanja Trifunovic11-Jun-10 16:35
Nemanja Trifunovic11-Jun-10 16:35 
AnswerRe: Templated array in class Pin
«_Superman_»11-Jun-10 20:51
professional«_Superman_»11-Jun-10 20:51 
GeneralRe: Templated array in class Pin
Niklas L11-Jun-10 22:40
Niklas L11-Jun-10 22:40 
AnswerRe: Templated array in class Pin
Niklas L11-Jun-10 21:56
Niklas L11-Jun-10 21:56 
AnswerRe: Templated array in class Pin
Aescleal12-Jun-10 8:12
Aescleal12-Jun-10 8:12 
Here's a quick counter question... Do you actually need an array?

The reason this springs to mind is that you've made the array private so no one outside of your interface can use it. Well, apart from using some disgusting tricks that you should burn in a personal hell for.

So if your final class interface is going to be something like:

template <class T, int first, int last>
class year_range
{
    public:
        T nth_year_in_range( int n );
};


you could actually eliminate the array wholesale:

T nth_year_in_range( int n )
{
    return T( start + n );
}


Of course if you need the array for something else then this won't work.

Cheers,

Ash
Questionmatrix operator = Pin
VeganFanatic11-Jun-10 12:13
VeganFanatic11-Jun-10 12:13 
AnswerRe: matrix operator = Pin
Chris Losinger11-Jun-10 15:05
professionalChris Losinger11-Jun-10 15:05 
GeneralRe: matrix operator = Pin
VeganFanatic11-Jun-10 15:39
VeganFanatic11-Jun-10 15:39 
GeneralRe: matrix operator = Pin
VeganFanatic11-Jun-10 15:42
VeganFanatic11-Jun-10 15:42 
AnswerRe: matrix operator = Pin
Aescleal11-Jun-10 20:06
Aescleal11-Jun-10 20:06 
AnswerRe: matrix operator = Pin
CPallini12-Jun-10 3:48
mveCPallini12-Jun-10 3:48 
QuestionMFC - Trying to load a picture from memory using Istream Pin
simon alec smith11-Jun-10 11:00
simon alec smith11-Jun-10 11:00 
AnswerRe: MFC - Trying to load a picture from memory using Istream Pin
Richard MacCutchan12-Jun-10 2:32
mveRichard MacCutchan12-Jun-10 2:32 
GeneralRe: MFC - Trying to load a picture from memory using Istream Pin
simon alec smith12-Jun-10 10:08
simon alec smith12-Jun-10 10:08 
GeneralRe: MFC - Trying to load a picture from memory using Istream Pin
Richard MacCutchan12-Jun-10 21:40
mveRichard MacCutchan12-Jun-10 21:40 
Questionmatrix multiplication Pin
VeganFanatic11-Jun-10 8:50
VeganFanatic11-Jun-10 8:50 
QuestionRe: matrix multiplication Pin
David Crow11-Jun-10 9:11
David Crow11-Jun-10 9:11 
AnswerRe: matrix multiplication Pin
VeganFanatic11-Jun-10 10:11
VeganFanatic11-Jun-10 10:11 
AnswerRe: matrix multiplication Pin
CPallini11-Jun-10 10:13
mveCPallini11-Jun-10 10:13 
QuestionParsing a .dat file to text file Pin
abyrini11-Jun-10 8:29
abyrini11-Jun-10 8:29 
AnswerRe: Parsing a .dat file to text file Pin
josda100011-Jun-10 8:37
josda100011-Jun-10 8:37 
AnswerRe: Parsing a .dat file to text file Pin
Luc Pattyn11-Jun-10 8:38
sitebuilderLuc Pattyn11-Jun-10 8:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.