Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pfultz2
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
by
pfultz2
4y ago
Yea and C++ static analysis tools already warn for the case, so even for new C++ programmers where it might not be entirely obvious, its still easy to catch the error.
2.
▲
by
pfultz2
4y ago
You dont need annotations, cppcheck already warns with: test.cpp:16:45: error: Using object that is a temporary. [danglingTemporaryLifetime] assert((std::vector<int>{1, 2, 3, 4} == append34({1, 2}))); // FAIL:
3.
▲
by
pfultz2
5y ago
Concepts specify constraints on templates, but the types are still templates, so you can't put the function definition in a .cpp file nor put them into a vector(which is what type erasure allows).
4.
▲
by
pfultz2
5y ago
That seems more like type erasure as defined in Java where the container is the same for all data types and the compiler implicitly inserts casts from the base type to the parameter type.
5.
▲
by
pfultz2
7y ago
But cppcheck can find a lot of dangling references with lambda captures.
6.
▲
by
pfultz2
7y ago
Clang's lifetime profile will catch the first example: <source>:8:16: warning: passing a dangling pointer as argument [-Wlifetime] std::cout << sv; ^ <source>:7:38: note: temporary
7.
▲
by
pfultz2
7y ago
Meson looks nice, but it still lacks a way to tell it where your dependencies are installed(like cmake’s CMAKE_PREFIX_PATH). You can try to get by, by setting pkg config path, but it doesn’t help for dependencies that don’t support pkgconfi
8.
▲
by
pfultz2
8y ago
> For the sake of history, `range` was found/coined by Andrei No it wasn't. Boost.Range library predates Andrei's Range talk in 2009. Boost.Range was introduced in boost 1.32, which was released in 2004: https://
9.
▲
by
pfultz2
8y ago
Higher density may allow for more volume but it can increase viscosity.
10.
▲
by
pfultz2
8y ago
Daniel Pfeffier’s effective cmake talks about how to do that. Setup each project standalone and get the dependencies with find_package. Then create a superprojects thats add each dependency with add_subdirectory and override find_package to
11.
▲
by
pfultz2
9y ago
> What does that do? It makes the variable x refer to the object that y is referring to In Java/C#, it doesn't always: int x = 1; int y = 2; x = y; The variable `x` does not refer to the object that `y` is referring to(as there
12.
▲
by
pfultz2
9y ago
> Currently there is no buildsystem that enables users to describe the requirements of an project correctly. We want to steer away from standardizing a build system for now. The uses cases are enormous to try to tackle. Instead, it would
13.
▲
by
pfultz2
9y ago
The package managers that are listed in the post are cross-platform and work on windows.
14.
▲
by
pfultz2
9y ago
Or rather, I would like to hear your opinion instead. Would buckaroo consider using a standard package metadata similar to what I outlined? I believe buckaroo uses integrated builds so its likely you would need to supplement it with other i
15.
▲
by
pfultz2
9y ago
> I'm surprised the author forgot to consider platform architectures That is mainly for binary distribution. Most C++ package managers currently are source-based because binary compatibility is not a easy problem(there are some pack
16.
▲
by
pfultz2
9y ago
> Wonder if Nix package manager would work here. The problem is extra work is needed to support things like cross compilation. Instead, you want to pass a toolchain file that describes the build environment(including for cross-compilatio
17.
▲
by
pfultz2
9y ago
You can't do that with United Airlines. The answers have to be picked from a drop-down of answers.
18.
▲
by
pfultz2
9y ago
Last time I looked at Nix it had a problem with dealing with cross-compilation. The problem is mainly that many packages still use autotools which does not have a descriptive toolchain. Ultimately, it could provide a descriptive toolchain a
19.
▲
by
pfultz2
9y ago
This sound similar to cmake-get: https://github.com/pfultz2/cmake-get
20.
▲
by
pfultz2
9y ago
pkg-config works on windows with visual studio as well.
21.
▲
by
pfultz2
9y ago
Actually cget can install packages directly from cmake packages(or other build systems). There is also the cmake-get module which can install cget recipes directly in the cmake without needing cget or python installed.
22.
▲
by
pfultz2
9y ago
The nice things about cget is that even though it uses python(which is mainly for easy distribution), the cget protocol only has a dependency on cmake. So cmake modulues like cmake-get[1] can install cget recipes directly in cmake without n
23.
▲
by
pfultz2
9y ago
> Too many C++ tools couple package management and build Conan does this too. If I follow the instructions to integrate cmake with conan, I would write something like this: include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
24.
▲
Cmake-get: A cmake module to get dependencies
(github.com)
1 points
by
pfultz2
9y ago
|
0 comments
25.
▲
by
pfultz2
10y ago
There is cget which install cmake packages out of the box, so many libraries don't need to be updated to support it: https://github.com/pfultz2/cget
26.
▲
by
pfultz2
10y ago
> The way I tend to write code, is to just start with my main function and write whatever procedural code I need to solve my problem. If I start seeing patterns, in my data or algorithms, that's when I start pulling things out. That
27.
▲
by
pfultz2
10y ago
C++ has already moved past OOP when it was standardized in the 90s by having a standard library built around regular types and generic programming. Here is Sean Parent's talk 'Inheritance Is The Base Class of Evil', which dis
28.
▲
by
pfultz2
10y ago
First, there is commonmark that is trying to standardize markdown. There is also recommonmark which will parse commonmark for sphinx: https://github.com/rtfd/recommonmark However, commonmark currently lack support for
29.
▲
by
pfultz2
11y ago
I don't think ExternalProject manages the packages. For example, cget won't install the package again if its already installed.
30.
▲
by
pfultz2
11y ago
I actually used python to make distribution easier. Otherwise, I would need to write Debian/RPM packages for linux, update homebrew for the mac, and windows installer for windows. So with python I just create one pypi package. It helps
More ›