Masthash

#cpp

Šimon Tóth
13 hours ago

Thanks GCC 😂 😂 😂 #cpp

Lizard Queen
15 hours ago

Ah made a blackjack game in C++. Inspiration hit: Boggle! #boggle #cpp #learning #programming

Šimon Tóth
15 hours ago

The trio of std::ranges::find_last, std::ranges::find_last_if and std::ranges::find_last_if_not are C++23 algorithms that find the last element matching the provided value or predicate.

While we could use std::ranges::find on bidirectional ranges with the same effect, these variants can operate on forward ranges.

Compiler Explorer link: https://compiler-explorer.com/z/Mfz7Wj9z6

#cpp #cplusplus #coding #programming #dailybiteofcpp

Venus
16 hours ago
C & C++ Weekly
17 hours ago

C & C++ recap for week 21/2023

https://discu.eu/weekly/candcpp/2023/21/

#cpp #cprogramming #programming

Get RSS feeds and support this bot with the premium plan: https://discu.eu/premium

Venus
1 day ago

I love bad Belle captions ❤️

#Pedo #cpp #mapp #cunny #caption #loli

C & C++ Weekly
2 days ago
Šimon Tóth
2 days ago

Sunday common C++ interview problem: Smallest interval to cover k sorted sequences.

Given k sequences of sorted integers, determine the smallest closed interval that covers at least one element from each sequence. For intervals of the same size should be ordered based on their lower bound value (i.e. [0,2]<[1,3]).

Solve it yourself: https://compiler-explorer.com/z/cqKo5WeMY
Solution: https://compiler-explorer.com/z/eeTMcbzP6

#cpp #cplusplus #coding #programming #dailybiteofcpp

Lawrence Murray
2 days ago

First release! Doxide: modern documentation for modern C++. Configure it with YAML, generate Markdown, publish it for the web with the marvelous Material for MkDocs by @squidfunk. Looking for feedback on this one and contributions welcome #cpp #cplusplus #docs #new #opensource #release https://doxide.org

Doxide logo
Markus Werle
2 days ago

@thephd

"What we need isn't diplomacy, it's accountability. We need people to take responsibility for what happened and to make amends."

This sentence will go the list of things to be also said in the C++ community. #cpp #cplusplus #cppcon

CC: @Patricia @copperspice_cpp

Šimon Tóth
3 days ago

Raw string literals (introduced in C++11) simplify the inclusion of multi-line text and strings that contain special characters that would otherwise have to be escaped.

Compiler Explorer link: https://compiler-explorer.com/z/acEeoGrTs

#cpp #cplusplus #coding #programming #dailybiteofcpp

Ale Funguju
3 days ago

Been sitting on this new release for a while, but it's out now! LibreArp 2.5 brings selection duplication, pattern playback offset, manual time signature settings and a few other usability improvements and bugfixes! Available at the usual spot: https://librearp.gitlab.io/download/

(Yea, I should probably make a separate Mastodon account for LibreArp...)

#LibreArp #VST #musicproduction #cpp #juce #opensource

C & C++ Weekly
3 days ago
Matúš Chochlík
3 days ago

Finally gotten around to improving my previously horribly convoluted cmake functions for building modules with clang, yay 💪

#cpp #cplusplus

https://github.com/matus-chochlik/eagine-core/blob/ab49f40e800c5d73fcbd65baae645c3182977cd6/config/EAGineCXXModulesClang.cmake#L19

I noticed recently that any time I hear about a bit of #rust drama, it's being pointed out by a prominent member of the #cpp community 🤔

Martin Helmut Fieber
4 days ago

New post! What is TAP and why do I love working with it? I'll tell, and show how to use it in different setups and languages, like C++, Lua, JavaScript, or even PostgreSQL.

https://martin-fieber.de/blog/tap-test-anything-protocol/

#TAP #TestAnythingProtocol #Cpp #Lua #JavaScript #Python #CSS #PostgreSQL

Anders Borch
1 week ago

Last time I did cross platform mobile dev I was using jdk 11. Today I just installed jdk 17 to get the latest toolchain up an running.

Currently I am:

- relearning c++ after 20 years
- relearning react native after (?) years
- learning rust
- security reviewing some php code
- security reviewing a mysql setup

I hope it pays off in the end.

#ReactNative #Cpp #Rust #Java #Android #iOS #Swift #PHP #MySQL #SecOps

That may seem like tag spam but I have actually been doing all of that in one week.

At least I get to sit outside while working.

My laptop running an Android simulator and an iOS emulator at the same time, while my dog is enjoying the sunshine in the background.
Fran
1 week ago

I've been on a couple of #Cpp #CplusPlus pod casts with #CppClub recently: https://cppclub.uk/meetings/2023/161/ and https://cppclub.uk/meetings/2023/161/

They are a great way to keep up to date and have both been very interesting.

Tushar Chauhan
1 week ago

A very interesting read:

https://kobzol.github.io/rust/python/2023/05/20/writing-python-like-its-rust.html

Some excellent ideas in there for people who come from tighter-typed languages like C++ and Rust.

On a personal note, I find writing type-aware code more satisfying. However, for needs where scripting, rather than actual software-hardware engineering is required, there is no beating python. Type-aware, functionally-leaning python is an excellent compromise that adds joy to the coding experience (for me) !

#programming #python #rust #cpp

jbz
2 weeks ago

「 Not differentiating between C and C++ also has the side effect of ostracizing new users. Many beginner programmers are lead by the term “C/C++” to think that they’re basically the same language. In fact there are many tutorials out there that are advertised as “C/C++ tutorials”, continuing the confusion. This can also scare away C beginners by making them think that understanding the complexities of C++ are required to understand C 」
via brycevandegrift.xyz

#C #Cpp
https://brycevandegrift.xyz/blog/stop-saying-c-and-c++/

Joxean Koret (@matalaz)
2 weeks ago

Question: is a C++ member function defined inside the class definition inlined in the final binary or not?

PS: If you are going to ask about some specific standard, let's pick, say, C++17.

#Cpp #cplusplus #Programming

C & C++ Weekly
2 weeks ago

[Using std::cpp] The C++ rvalue lifetime disaster - Arno Schödl. think cell

https://www.youtube.com/watch?v=Tz5drzXREW0

Discussions: https://discu.eu/q/https://www.youtube.com/watch?v=Tz5drzXREW0

#cpp #programming

Paolo G. Giarrusso
2 weeks ago

#Cpp lawyering time: Given `p` of type `T*` (with `T` not a character/byte type), `&*p` requires `p` to actually point to an object or function — but must it be of type `T` (up to signedness)?

https://stackoverflow.com/q/76250080/53974

Rust Weekly
3 weeks ago

Feedback requested: Slint (declarative GUI toolkit) is discussing license changes

https://github.com/slint-ui/slint/discussions/2706

Discussions: https://discu.eu/q/https://github.com/slint-ui/slint/discussions/2706

#cpp #programming #rustlang

C & C++ Weekly
3 weeks ago

How NanoMQ had a double free and what we can learn from it or why i ditched C++ for Rust

https://nereux.blog/posts/nanomq-double-free/

Discussions: https://discu.eu/q/https://nereux.blog/posts/nanomq-double-free/

#cpp #programming #rustlang

InfoQ
3 weeks ago

C++ has been around for a long time but has changed significantly since 2011. A new standard, referred to as C++11 was introduced then, marking the beginning of a new era of frequent updates.

If you haven't used C++ since before C++11, you have a lot to catch up on, so where do you start? No worries, Frances Buontempo has you covered: https://bit.ly/3Bhnt7Z

#Cpp #Cplusplus #ProgrammingLanguages #Compilers

C:\KKJ\>:idle:
3 weeks ago

💾 8.7KB and I got working engine with timer :)

Now it's time to move all the remaining code and my ray-marching shader!

#coding #CPP #demoscene

C & C++ Weekly
3 weeks ago

A collection of lock-free data structures written in standard C++11

https://github.com/DNedic/lockfree

Discussions: https://discu.eu/q/https://github.com/DNedic/lockfree

#cpp #programming

C:\KKJ\>:idle:
3 weeks ago

Latest approach to the smallest OpenGL/C++ one shader renderer.

I tricked the #ChatGPT by starting the chat about demoscene and sizecoding. Then get it to generate relevant code :)

Current size 7.5KB 💾

#coding #CPP #demoscene

Anders Borch
3 weeks ago

Was C++ always super annoying to work with, or did I just grow dumber with age? Was Visual Studio always so fragile and error-prone, or did I just get used to good IDEs?

Confusingly, VS Code seems massively better than Visual Studio. Intellisense handling for TypeScript in VSCode seems so much more stable than it does for C++ in VS.

Wasn't VS supposed to be an upgrade from VSCode?

Wasn't C++ supposed to be more type-safe than TypeScript?

#typescript #cpp

jbz
3 weeks ago

🤸 Building a Physics Engine with C++ and Simulating Machines
— AngeTheGreat

#Gamedev #PhysicsEngine #Cpp #CPlusPlus
https://m.youtube.com/watch?v=TtgS-b191V0&feature=youtu.be

Sonny Bonds
1 month ago

build.h is now Wilco! 🥳

Still got ways to go and is mostly powered by sunken cost fallacy, but getting a name on it feels like a symbolic but important step.

https://github.com/SonnyBonds/wilco

#cpp #programming #buildsystems

Sonny Bonds
1 month ago

A status update on the build system, since I know you're all dying to know... 🙄

Having custom commands with proper dependencies turned out to be a hassle, BUT I think I got it working properly. Needed to have the command manually write "tlog" files for MSVC to track changes. Hard to figure out, but simple to do.

Actually starting to run out of big obvious pieces missing, which is cool.

Still procrastinating things like deciding on a name though...

#cpp #buildsystems #programming

Šimon Tóth
1 month ago

Wow, OK, I read a lot of cursed code, but this is something else.

https://devblogs.microsoft.com/oldnewthing/20230403-00/?p=108005

#cpp

Sonny Bonds
2 months ago

I'd almost given up on getting properly sequenced custom build steps working in VS/MSBuild in a satisfactory way (i.e. not involving too re-running stuff always), but I just got a lifeline thrown to me in the form of <UpToDateCheckInput>.

It allows explicitly adding inputs/outputs to Visual Studios early exit up to date checker, so it understands that it should trigger a build when an input to a custom target has changed.

I realize I'm talking into a bored void here, but still.

#cpp #msbuild

KDAB
2 months ago

We had a great time organizing our first in-person event after the pandemic! The event revolved all around software development with Qt. Over 20 talks about #qtdev, #rustlang, #embedded, #qml, #python and #cpp are available for you on our YT channel!

🔗 https://www.youtube.com/playlist?list=PL6CJYn40gN6h5jKSLw0cEsKficprxd2iX

Sonny Bonds
2 months ago

========== Elapsed 2:06 PM ==========

Visual Studio, that's not a duration. That's not how clocks work.

#cpp #programming #visualstudio

KDAB
2 months ago

📰 KDAB News 03/2023 - Interview with KDE's Adam Szopa about KDE Akademy 2023; Calls for speakers for Qt Desktop Days & Qt World Summit 2023; Embedded World 2023 Recap and more #qtdev #cpp #cplusplus #embedded #desktop

🔗 https://www.youtube.com/watch?v=VQp9IFciH08

Astra Kernel :verified:
2 months ago

🦀 "Why the Rust Community Should Be Worried About the New Carbon Language"

👉 should we?

👉 If we some language can do what Rust can do but more simpler, we should be happy to switch but is that the case here?

Article:
https://towardsdev.com/why-the-rust-community-should-be-worried-about-the-new-carbon-language-3a0ab07d6ce5

#rustlang #rust #cpp #carbon

Fran
2 months ago

Chapter 5 of my C++ book is now up:

Playing with a full deck! Learn to work with classes, constructors, comparison operators, and random shuffle as you create a full deck of cards and write a fun card-guessing game.

https://www.manning.com/books/c-plus-plus-bookcamp #Cpp #CplusPlus

Fran
2 months ago

@ManningPublications are running a MEAP flash sale at manning.com with all MEAPs 45% off. Offer expires midnight ET, March 29. Buy my book #CPP #CplusPlus https://www.manning.com/books/c-plus-plus-bookcamp, someone else's book or just look at all the books.

Astra Kernel :verified:
2 months ago

🦀 NIST(National Institute of Standards and Technology) added Rust to list of Safer languages list

https://www.nist.gov/itl/ssd/software-quality-group/safer-languages

#rustlang #rust #infosec #appsec #cpp #programming

"Rust has an ownership model that guarantees both memory safety and thread safety, at compile-time, without requiring a garbage collector. This allows users to write high-performance code while eliminating many bug classes. Though Rust does have an unsafe mode, its use is explicit, and only a narrow scope of actions is allowed. (14 Mar 2023)"
Sonny Bonds
2 months ago

For anyone following along, I'm refactoring a bunch of dependency checking to be better and faster, with the downside that it keeps more saved state. I think it'll turn out good though.

But honestly it's already fast enough. I'm really just procrastinating polishing things up and fixing some msvc & ninja generation issues.

#cpp #buildsystems

Sonny Bonds
2 months ago

Replacing "input timestamp > output timestamp" based dirty checking with an
"Input timestamp changed" based one turned out to be more complex than I anticipated.

When it's working enough to do better testing I may have to evaluate if it's worth it. It can possibly be faster and also have better tolerance with low precision timestamps, but I'm worried all the statefulness makes it brittle.

#cpp #buildsystems

Šimon Tóth
2 months ago

The C++23 added the std::spanstream, effectively a std::stringstream equivalent operating on a borrowed contiguous range.

std::spanstream can be used to directly parse text stored in raw memory, string_views or string literals.

When using std::spanstream for writing, the std::spanstream will write as much output as fits into the output span, which can be inconvenient.

Compiler Explorer link: https://compiler-explorer.com/z/occYKs4d5

#cpp #cplusplus #coding #programming #dailybiteofcpp

Switching From C++ to Rust, https://laplab.me/posts/switching-from-cpp-to-rust/.

> After all of this, coming to Rust feels like I was suddenly forgiven and moved from Hell to Heaven.

Interesting testimony. The author mention Build system, Compiler, and Type System.

#RustLang #Cpp

Sonny Bonds
3 months ago

Okay, so it just seems like for whatever reason the MS STL iostreams implementation is doing something different than others, making reading a full file with iostreams slower than with fread.

Building my test with mingw or on WSL (I'm currently on Windows) makes iostream & fread equally fast.

Christian Adam has found the same things here: https://cristianadam.eu/20160410/c-plus-plus-i-slash-o-benchmark/

#cpp

Sonny Bonds
3 months ago

Is it just me or is fopen/fread quite a lot faster than ifstream even for just reading a binary blob? I don't have isolated benchmarks right now, but implementing a "readFile" function in my build with FILE* instead of ifstream yields a 10% total speedup, and according to the profiler the time of the ifstream version was ~20% of total runtime. So... A 2x difference on the readFile itself maybe, which sounds insane?

#cpp #programming

Josiah Winslow
3 months ago

Most of my comments in ITDEV-185 leaned more towards being "normal" (because this time, I knew someone else besides me was reading them). #cpp

/*
I want to be able to have the prompt argument of inputLongDouble and
inputIntInRange be of any type, but I can't figure out templates, and std::any
isn't usable yet.

It would also be nice for me to be able to ask for and return any type of number
with minimal copy-pasting. I suppose this means I've gotten way too used to more
weakly-typed languages.

By the way, the entire reason I'm relegating these to functions instead of using
cin >> variableName is because I want to validate the input without some sort of
runtime error. Which, as it turns out, isn't as easy as I thought. Go figure.
*/
char fullName[42] = {}; // Specs say 40, but I added room for the space+comma
// In another language, I'd call the no-args constructor inside the other one.
// But this isn't another language. This is C++.
void init();
void clearScreen()
{
    // Try running "cls", which works on Windows
    // However, if an error code is given (i.e. not 0)...
    if (system("cls"))
    {
        // "clear" will probably work
        system("clear");
    }
    // Any more competent implementation might use macros somehow,
    // but this will be fine.
}
Josiah Winslow
3 months ago

I've done a lot of #coding for my college courses. And I've written a lot of #comments.

Here are some highlights I've found. I'll update as I find more.

THREAD 🧵

#code #programming #dev #webdev #html #css #js #java #cpp #php