|
|
Update: Not a compiler bug. User error. GCC is more forgiving and the error message was weird. That was my first suspicion but after banging on it for an hour I decided it wasn't me. Then I posted here, which invoked Murphy's Law by making me look like an idiot, but at least my code works now, so it did its job.
template <typename PixelType,typename... ChannelNames> class has_channel_names_impl;
template<typename PixelType,typename ChannelName,typename... ChannelNames>
class has_channel_names_impl<PixelType,ChannelName,ChannelNames...> {
using chidx = typename PixelType::template channel_index_by_name<ChannelName>;
public:
constexpr static const bool value = (-1!= chidx::value) &&
has_channel_names_impl<PixelType,ChannelNames...>::value;
};
template<typename PixelType>
class has_channel_names_impl<PixelType> {
public:
constexpr static const bool value = true;
};
This isn't pretty, but what it does is it looks through a pixel definition to see if the pixel has a channel or channels with particular names, at compile time.
So Microsoft, explain to me the situation in which value does not resolve to a compile time constant, because that's what your compiler is telling me sometimes. Apparently it depends on the context in which it's being used/instantiated, or maybe the day of the week. Who knows?
I'm not well. I don't need compiler bugs right now.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
modified 28-Aug-24 2:04am.
|
|
|
|
|
nope, sorry. You beat your head on this for an hour. You had three choices: 1) go take a dump. bring notebook; 2) take a shower, while washing hair answer will come to you; 3) Post on CP, answer will become immediately obvious - where's the delete button.
There is an option 4, post on stackoverflow (worst site ever imho) and get reamed for being stupid, reposting, duplicating, yada yada.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
Well, it worked. Y'all got to be my rubber duck.
As an aside, MSVC++ gives the WORST error messages.
static inline gfx_result image(Destination& destination, const rect16& destination_rect, const image& source_image, const rect16& source_rect = rect16(0, 0, 65535, 65535), const srect16* clip = nullptr);
It said this function did not take 5 arguments. I was pulling my hair out for an hour on this too.
static inline gfx_result image(Destination& destination, const rect16& destination_rect, const ::gfx::image& source_image, const rect16& source_rect = rect16(0, 0, 65535, 65535), const srect16* clip = nullptr);
That fixed it.
ETA: It may look strange to call the method image that itself takes an image. It's part of my draw facilities and ends up getting used like this:
png_image img(VisualFA128);
gfx_result r = img.initialize();
if(r!=gfx_result::success) {
printf("img init failure %d\n",(int)r);
while(1);
}
r=draw::image(panel_fb,img.bounds().center(panel_fb.bounds()),img);
if(r!=gfx_result::success) {
printf("draw error: %d\n",(int)r);
}
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
modified 28-Aug-24 8:18am.
|
|
|
|
|
What did you change ?
Edit just spotted it
::gfx::
No wonder it had you flummoxed
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
1st vs 2nd codeblock in the previous comment, 3rd parameter to the function
from const image&
to const ::gfx::image&
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
I guess it's just old guy symptom but you folks write code in code.
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
I've spent all day beating on a problem with no success. Then:
1) I put it away, the next morning I spot the problem in 3 seconds.
2) Or, I call someone over; they spot the problem in 3 seconds.
3) Or, I call someone over; then *I* spot the problem in 3 seconds.
Of course, I've had co-workers call me to help, and I spot the problem in 3 seconds. Typically, the person feels stupid, but the reality is that after staring at something too long, we don't see what's there -- we see what we expect to be there.
The best course of action is to walk away for an hour -- do something else, then come back.
To be fair, not all problems are solved so easily.
My freshman year in college, working on a DEC/VAX, the program I wrote was failing to compile on a specific line, and the error made no sense. I took it to the professor, and he acted disgusted, expecting a newbie programmer problem. He read through that section twice. Frowned, and said, "That is written correctly." He thought for another moment and said, "Delete that line plus the one above and below. Retype them."
An unprintable character had been inserted into the file and the compiler choaked on it. Retyping those 3 lines solved it.
|
|
|
|
|
Let's play the "I like/dislike dark mode game".
The rules are simple, you get to state in one sentence the most important reason you like or dislike light or dark mode. You get to add one sentence only, not entire paragraphs. Be funny. Be serious. It's up to you. Just stay civil and don't start a religious war over someone else's preference. I'll start:
I dislike dark mode because all I can see on a bright sunny afternoon is the dust on my monitor.
Your turn.
|
|
|
|
|
I like dark mode because I'm awake a lot during the wee hours, and a dark screen in a dark room is much easier on the eyes.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
That's the one thing I'll say in favor of dark mode - even with the brightness reduced as much as possible (which it how I work all the time), the average monitor is still glowing bright, relatively speaking, in full darkness.
I don't work all that much in the wee hours. But then, there's a reason you're called the code witch.
|
|
|
|
|
I like bright rooms so I tend to like light mode. I never use my computer without turning on the room lights.
|
|
|
|
|
I like dark mode because it hides the fact that I haven't cleaned my screen in months.
|
|
|
|
|
So, you're claiming the exact opposite I do: In dark mode, I can see all the dust covering my monitor. In light mode, I can't see the dust as it gets "drowned out" by the bright light.
|
|
|
|
|
I like dark mode because light mode is too bright when you're recovering from a hangover.
|
|
|
|
|
I dislike dark mode because it reminds me I'm not reading a real book.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I dislike dark mode because my old eyes need light.
|
|
|
|
|
Dark mode makes the voices in my head louder ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Is that the Summoning Darkness or the Guarding Darkness?
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
It's a floating eyeball with a curly tail, so Summoning Dark, I think.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I like dark mode because I have dark eyes.
|
|
|
|
|
I like black text in dark mode, because it weeds out crappy developers who aren't serious.
|
|
|
|
|
Incidentally, this was told as a trick in resume writing. Sometimes back it was reported that a candidate got an interview call, and ultimately landed a job in one of the top companies, and she had shared her trick.
This candidate has written her profile and projects as usual, with black letters on white background. But also had written all the AI-ML-DataScience keywords in white text on white background - these would not be printed, but the resume-screening software in the big companies would recognise these buzzwords, that she had worked on those technologies, and would immediately shortlist her for interview. Neat trick in fooling that software.
|
|
|
|
|
I'm sorry, I cant read this because I made the mistake of opening CodeProject, which doesn't have a dark mode, at night and now I'm blind.
|
|
|
|
|
|