Click here to Skip to main content
15,885,546 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.

 
GeneralRe: CCC - 22-07-2022 - Winner Pin
pkfox21-Jul-22 22:14
professionalpkfox21-Jul-22 22:14 
GeneralRe: CCC - 22-07-2022 Pin
FreedMalloc22-Jul-22 6:35
FreedMalloc22-Jul-22 6:35 
GeneralSound of the Week Pin
Sander Rossel21-Jul-22 20:40
professionalSander Rossel21-Jul-22 20:40 
GeneralRe: Sound of the Week Pin
David O'Neil22-Jul-22 3:58
professionalDavid O'Neil22-Jul-22 3:58 
GeneralRe: Sound of the Week Pin
Sander Rossel22-Jul-22 4:48
professionalSander Rossel22-Jul-22 4:48 
GeneralRe: Sound of the Week Pin
David O'Neil22-Jul-22 5:04
professionalDavid O'Neil22-Jul-22 5:04 
GeneralRe: Sound of the Week Pin
Sander Rossel23-Jul-22 23:31
professionalSander Rossel23-Jul-22 23:31 
GeneralGosh C++ spoils me Pin
honey the codewitch21-Jul-22 14:39
mvahoney the codewitch21-Jul-22 14:39 
My hubby is in the backyard building FSM only knows what for the chickens.

I'm in here trying to work out a problem at runtime that I solved at compile time already in spades.

And I realize how spoiled I am by template metaprogramming. Some problems are actually *easier* to solve at compile time using the aforementioned technique. That kind of caught me by surprise, actually, until I ran into it.

I'm having to convert digital audio samples from one bit depth to the other, one sample rate to the other, one channel config to another and composing something to do so efficiently at run time on a tiny device.

I do something similar in my GFX library at compile time no problem, because I can pseudo-dynamically manipulate types themselves, which can make things much easier, particularly when you don't know the size of your data ahead of time.

I was thinking of making a daisy chaining jump table to do each of the conversions in turn, and build that table at run time. Each function in the jump table would a read buffer to a write buffer, performing one of the conversion steps but it seems rickety and complicated.

I'm not looking for solutions here - I'm good with the challenge - just vent/praising C++ compile time vs anything else (including C++) at runtime.

I did like being surprised by a compile time problem being much easier that a runtime problem using metaprogramming techniques.
To err is human. Fortune favors the monsters.

GeneralRe: Gosh C++ spoils me Pin
Super Lloyd21-Jul-22 15:50
Super Lloyd21-Jul-22 15:50 
GeneralRe: Gosh C++ spoils me Pin
CPallini21-Jul-22 20:16
mveCPallini21-Jul-22 20:16 
GeneralRe: Gosh C++ spoils me Pin
Maximilien22-Jul-22 0:56
Maximilien22-Jul-22 0:56 
GeneralWordle 398 Pin
Amarnath S21-Jul-22 14:31
professionalAmarnath S21-Jul-22 14:31 
GeneralRe: Wordle 398 Pin
Peter_in_278021-Jul-22 16:23
professionalPeter_in_278021-Jul-22 16:23 
GeneralRe: Wordle 398 Pin
musefan22-Jul-22 1:34
musefan22-Jul-22 1:34 
GeneralRe: Wordle 398 Pin
Sandeep Mewara21-Jul-22 16:44
mveSandeep Mewara21-Jul-22 16:44 
GeneralRe: Wordle 398 Pin
OriginalGriff21-Jul-22 18:51
mveOriginalGriff21-Jul-22 18:51 
GeneralRe: Wordle 398 Pin
Amol_B21-Jul-22 19:56
professionalAmol_B21-Jul-22 19:56 
GeneralRe: Wordle 398 Pin
den2k8821-Jul-22 20:38
professionalden2k8821-Jul-22 20:38 
GeneralRe: Wordle 398 Pin
Sander Rossel21-Jul-22 20:46
professionalSander Rossel21-Jul-22 20:46 
GeneralRe: Wordle 398 Pin
musefan22-Jul-22 1:50
musefan22-Jul-22 1:50 
GeneralRe: Wordle 398 Pin
den2k8822-Jul-22 1:56
professionalden2k8822-Jul-22 1:56 
GeneralRe: Wordle 398 Pin
Amarnath S22-Jul-22 1:59
professionalAmarnath S22-Jul-22 1:59 
GeneralRe: Wordle 398 Pin
pkfox21-Jul-22 20:52
professionalpkfox21-Jul-22 20:52 
GeneralRe: Wordle 398 Pin
ChandraRam21-Jul-22 21:36
ChandraRam21-Jul-22 21:36 
GeneralRe: Wordle 398 Pin
Greg Utas22-Jul-22 0:10
professionalGreg Utas22-Jul-22 0:10 

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.