Skip to content

Piero Bosio Social Web Site Personale Logo Fediverso

Social Forum federato con il resto del mondo. Non contano le istanze, contano le persone

Mondays frequently feel like just hanging on kind of days.


Gli ultimi otto messaggi ricevuti dalla Federazione
  • This post did not contain any content.
    read more

  • This post did not contain any content.
    read more

  • @kenobit consultati con qualcuno per le kettle, perché così a naso con le mie conoscenze di fisica tenere muscoli e tendini delle braccia in tensione e trazione pressoché continua per 30 minuti può avere effetti indesiderati...

    read more

  • I asked claude.ai to write a spreadsheet. exactly like that. this is what it came back with.

    https://this.how/ai/spreadsheet.html

    read more

  • @oblomov @GustavinoBevilacqua @ALFA Avrei detto meno! Ho trovato anche delle indicazioni di spessori più bassi, può darsi che il numero si possa dimezzare

    read more

  • @riley @lesley you can have (multiple) inheritance even with a struct

    read more

  • @oblomov Having foo be a class and not a struct would make some things a lot more complicated. If there's no other way, I'd probably prefer to generate automatically the procedures that take struct bar *, invoke the converter explicitly, and then call the hand-written procedures, over doing multiple inheritance.

    @lesley

    read more

  • @ananas You're thinking about something weird.

    I want to do something like this, which, as you can see, is so perfectly cromulent than it compiles and runs:

    #include <stdio.h>
    #include <stdlib.h>

    struct bar {
    int paydirt;
    };

    struct foo {
    int some_field_here;
    struct bar cheap_dirt;

    operator bar &() {
    return cheap_dirt;
    }
    };

    void work_on_paydirt (struct bar &object) {
    printf("Teh paydirt is %i\n", object.paydirt);
    }

    struct foo the_foo;
    struct bar the_bar;

    int main () {
    work_on_paydirt(the_foo);
    work_on_paydirt(the_bar);
    return EXIT_SUCCESS;
    }

    I just want work_on_paydirt, for historic compatibility reasons, to take struct bar * rather than struct bar & as its argument. Logic-wise, maintenance-wise, there's no difference. Even the generated code is exactly the same (modulo the mangled names). But C++ syntax is only happy to let me define an explicit conversion operator for a struct-to-struct-reference, and not for the same struct's pointer to a struct pointer. I'm not trying to do anything exotic here, or type punning or obfuscatory stuff; I just want the translator to implicitly invoke my type converter for a pointer-to-struct type, just like it can for a referenced-struct type.

    read more
Post suggeriti