Click here to Skip to main content
16,016,391 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
JokeThe squirrels must be expecting a cold winter as they seem to be gathering more nuts than usual. Pin
honey the codewitch52mins ago
mvahoney the codewitch52mins ago 
JokeRe: The squirrels must be expecting a cold winter as they seem to be gathering more nuts than usual. Pin
Daniel Pfeffer15mins ago
professionalDaniel Pfeffer15mins ago 
QuestionWould it work? Pin
Joan M4hrs ago
professionalJoan M4hrs ago 
AnswerRe: Would it work? Pin
charlieg3hrs 44mins ago
charlieg3hrs 44mins ago 
AnswerRe: Would it work? Pin
charlieg3hrs 34mins ago
charlieg3hrs 34mins ago 
AnswerRe: Would it work? Pin
Jacquers1 hr 44mins ago
Jacquers1 hr 44mins ago 
GeneralWordle 1,204 Pin
GKP199211hrs 24mins ago
professionalGKP199211hrs 24mins ago 
GeneralRe: Wordle 1,204 - 4 4 me Pin
pkfox10hrs 38mins ago
professionalpkfox10hrs 38mins ago 
GeneralRe: Wordle 1,204 Pin
OriginalGriff10hrs 16mins ago
mveOriginalGriff10hrs 16mins ago 
GeneralRe: Wordle 1,204 Pin
StarNamer@work6hrs 52mins ago
professionalStarNamer@work6hrs 52mins ago 
GeneralRe: Wordle 1,204 Pin
Cp-Coder5hrs 19mins ago
Cp-Coder5hrs 19mins ago 
GeneralAh the joys of late stage optimization Pin
honey the codewitch21hrs 17mins ago
mvahoney the codewitch21hrs 17mins ago 
GeneralRe: Ah the joys of late stage optimization Pin
obermd19hrs 12mins ago
obermd19hrs 12mins ago 
GeneralRe: Ah the joys of late stage optimization Pin
honey the codewitch18hrs 21mins ago
mvahoney the codewitch18hrs 21mins ago 
GeneralRe: Ah the joys of late stage optimization Pin
PIEBALDconsult16hrs 36mins ago
mvePIEBALDconsult16hrs 36mins ago 
GeneralRe: Ah the joys of late stage optimization Pin
trønderen16hrs 15mins ago
trønderen16hrs 15mins ago 
GeneralRe: Ah the joys of late stage optimization Pin
obermd15hrs 5mins ago
obermd15hrs 5mins ago 
GeneralRe: Ah the joys of late stage optimization Pin
charlieg5hrs 46mins ago
charlieg5hrs 46mins ago 
GeneralRe: Ah the joys of late stage optimization Pin
honey the codewitch4hrs 13mins ago
mvahoney the codewitch4hrs 13mins ago 
They are basically that.

I think of them as kind of a mail merge with "smart" (typed) arguments.

A template is a source code generator. The C++ compiler process the arguments using the compiler's type info, and then emits more *textual* C++ code as a result. That result is then fed back into the compiler and parsed, much like a preprocessor macro.

Where templates get primarily confusing is template specializations, but that's where their real power is, and what I'm using above.

The two struct templates are part of the same overall template. The second one is a specialization for when the draw destination is a bitmap<rgba_pixel<32>>. When the compiler sees that it generates the alternate.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix

GeneralRe: Ah the joys of late stage optimization Pin
charlieg3hrs 8mins ago
charlieg3hrs 8mins ago 
GeneralRe: Ah the joys of late stage optimization Pin
honey the codewitch2hrs 54mins ago
mvahoney the codewitch2hrs 54mins ago 
GeneralOpening up the web to embedded (CSS post thoughts ctd) Pin
honey the codewitch23hrs 21mins ago
mvahoney the codewitch23hrs 21mins ago 
GeneralRe: Opening up the web to embedded (CSS post thoughts ctd) Pin
Gary Stachelski 202121hrs 43mins ago
Gary Stachelski 202121hrs 43mins ago 
GeneralRe: Opening up the web to embedded (CSS post thoughts ctd) Pin
honey the codewitch21hrs 40mins ago
mvahoney the codewitch21hrs 40mins ago 
GeneralRe: Opening up the web to embedded (CSS post thoughts ctd) Pin
Gary Stachelski 202120hrs 32mins ago
Gary Stachelski 202120hrs 32mins ago 

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.