home.social

Search

86 results for “glloyd”

  1. @glloyd It crops up in other places, not just iterators. I first encountered it using a coroutine library where the promise type was a std::expected. I did the usual “how am I being stupid” for a while before I figured it wasn’t me (for once). #cpp #cplusplus #clang #cpp26

  2. @glloyd It crops up in other places, not just iterators. I first encountered it using a coroutine library where the promise type was a std::expected. I did the usual “how am I being stupid” for a while before I figured it wasn’t me (for once).

  3. @glloyd It crops up in other places, not just iterators. I first encountered it using a coroutine library where the promise type was a std::expected. I did the usual “how am I being stupid” for a while before I figured it wasn’t me (for once). #cpp #cplusplus #clang #cpp26

  4. @glloyd It crops up in other places, not just iterators. I first encountered it using a coroutine library where the promise type was a std::expected. I did the usual “how am I being stupid” for a while before I figured it wasn’t me (for once). #cpp #cplusplus #clang #cpp26

  5. @glloyd It crops up in other places, not just iterators. I first encountered it using a coroutine library where the promise type was a std::expected. I did the usual “how am I being stupid” for a while before I figured it wasn’t me (for once). #cpp #cplusplus #clang #cpp26

  6. @glloyd Reasons to skip #meetups and #TechEvents: honestly, I am shy and feel like I am not good enough for the community. I feel like they have higher knowledge and I would just annoy them. I feel like the community would reject me as a noob. I talk about the community around me.

  7. I finally wrote up something I've presented at meetups for a while.

    When you refactor, you're doing similar transformations compilers do: propagation, sinking, inlining, fusion. But the refactoring literature has gaps, some useful moves don't have names. In this post I called one "Distribute for Fusion", deliberately duplicating code into branches so you can fuse and simplify.

    ignition.github.io/posts/refac

    Does this have an established name?

  8. I finally wrote up something I've presented at meetups for a while.

    When you refactor, you're doing similar transformations compilers do: propagation, sinking, inlining, fusion. But the refactoring literature has gaps, some useful moves don't have names. In this post I called one "Distribute for Fusion", deliberately duplicating code into branches so you can fuse and simplify.

    ignition.github.io/posts/refac

    Does this have an established name?

    #cpp #refactoring #programming

  9. is has issues when module import is in a header file, and not the cpp file. This is not a problem for clang, its all in the same translation unit. AFAICT this is legal and fine C++20 module code, clangd shouldn't have this issue.

    github.com/llvm/llvm-project/i

  10. [EDIT: this is wrong, read thread]

    Interesting issue.
    When using its possible to have a fixit applies multiple times causing incorrect code.

    I believe what is happening is the cppm is the source text, but its analysed in other translation unit by the module import which uses its pcm. In parallel they both read and apply their fixit and you get situations like NULL becoming nullptrptr.

    I'll try and make a minimal example at some point.

  11. [EDIT: this is wrong, read thread]

    Interesting #clangtidy issue.
    When using #cppmodules its possible to have a fixit applies multiple times causing incorrect code.

    I believe what is happening is the cppm is the source text, but its analysed in other translation unit by the module import which uses its pcm. In parallel they both read and apply their fixit and you get situations like NULL becoming nullptrptr.

    I'll try and make a minimal example at some point.

    #cpp #cplusplus

  12. [EDIT: this is wrong, read thread]

    Interesting #clangtidy issue.
    When using #cppmodules its possible to have a fixit applies multiple times causing incorrect code.

    I believe what is happening is the cppm is the source text, but its analysed in other translation unit by the module import which uses its pcm. In parallel they both read and apply their fixit and you get situations like NULL becoming nullptrptr.

    I'll try and make a minimal example at some point.

    #cpp #cplusplus

  13. [EDIT: this is wrong, read thread]

    Interesting #clangtidy issue.
    When using #cppmodules its possible to have a fixit applies multiple times causing incorrect code.

    I believe what is happening is the cppm is the source text, but its analysed in other translation unit by the module import which uses its pcm. In parallel they both read and apply their fixit and you get situations like NULL becoming nullptrptr.

    I'll try and make a minimal example at some point.

    #cpp #cplusplus

  14. [EDIT: this is wrong, read thread]

    Interesting #clangtidy issue.
    When using #cppmodules its possible to have a fixit applies multiple times causing incorrect code.

    I believe what is happening is the cppm is the source text, but its analysed in other translation unit by the module import which uses its pcm. In parallel they both read and apply their fixit and you get situations like NULL becoming nullptrptr.

    I'll try and make a minimal example at some point.

    #cpp #cplusplus

  15. DECLARE_CONSTEXPR
    template<typename T>
    constexpr int f1(); // works

    template<typename T>
    inline int f1(); // also works

    template<>
    constexpr int f1<int>(){ return 1;}

    static int global = 2;
    template<>
    inline int f1<double>(){ return global;}

    constexpr int f2(); // here declaration must match definition
    constexpr int f2() { return 3; }

    int main() {
    constexpr auto v1 = f1<int>();
    auto const v2 = f1<double>();
    auto const v3 = f2();
    return v1 + v2 + v3;
    }

  16. Any diagnostic to find cyclic dependencies?

    set(CMAKE_CXX_SCAN_FOR_MODULES ON)
    add_library(A STATIC)
    target_sources(A PUBLIC
    FILE_SET CXX_MODULES FILES mod.cppm # export module x;
    )
    target_link_libraries(A PRIVATE B)
    add_library(B STATIC use.cpp) # import x;
    target_link_libraries(B PRIVATE A)

    All you get ATM is failure at compile time `fatal error: module 'x' not found`

    But it would be nice to know that the real issue is that A and B make a cycle

  17. What is the reasonable way to test internal parts of a module?

    For a complex module I want unit tests for parts that I do not want to export. Do I make an internals module that can be tested. Then have the actual module which only re-export what I intend to be the library's interface?

  18. Working with with and

    How can I run just the scan/dynamic based bits so that I can run clang-tidy without a full build?

    ATM I have this hack
    ```
    # cmake config
    cmake --preset thing

    # select what I need made
    ninja -C build -t inputs | grep -E '\.cppm\.o$|\.o\.modmap$' | xargs -r ninja -C build

    # then I can run clang-tidy
    ```

    There must be a better way

  19. Working with #cpp20 #cppmodules with #ninjabuild and #cmake

    How can I run just the scan/dynamic based bits so that I can run clang-tidy without a full build?

    ATM I have this hack
    ```
    # cmake config
    cmake --preset thing

    # select what I need made
    ninja -C build -t inputs | grep -E '\.cppm\.o$|\.o\.modmap$' | xargs -r ninja -C build

    # then I can run clang-tidy
    ```

    There must be a better way

    #cpp #cplusplus #programming

  20. Working with #cpp20 #cppmodules with #ninjabuild and #cmake

    How can I run just the scan/dynamic based bits so that I can run clang-tidy without a full build?

    ATM I have this hack
    ```
    # cmake config
    cmake --preset thing

    # select what I need made
    ninja -C build -t inputs | grep -E '\.cppm\.o$|\.o\.modmap$' | xargs -r ninja -C build

    # then I can run clang-tidy
    ```

    There must be a better way

    #cpp #cplusplus #programming

  21. Working with #cpp20 #cppmodules with #ninjabuild and #cmake

    How can I run just the scan/dynamic based bits so that I can run clang-tidy without a full build?

    ATM I have this hack
    ```
    # cmake config
    cmake --preset thing

    # select what I need made
    ninja -C build -t inputs | grep -E '\.cppm\.o$|\.o\.modmap$' | xargs -r ninja -C build

    # then I can run clang-tidy
    ```

    There must be a better way

    #cpp #cplusplus #programming