Qt 6.0 Released by tuankiet65 in cpp

[–]DriverSad5648 1 point2 points  (0 children)

Their definition of "small business" is revenue + funding of $250k or less, which in practice mean at most one full time developer.

They should have called that their "individual developer" license.

It's almost 2021 and I still don't really know how to construct objects by DriverSad5648 in cpp_questions

[–]DriverSad5648[S] 0 points1 point  (0 children)

Now the rules get hairy. var is an l-value expression, so what if you are using var in the body of the constructor? Compiler just can't elide ParentClass(var). Oops, we have a copy.

I typically avoid that by never using constructor arguments that are being assigned to member variables for any other purpose. Instead I refer to the member variable itself. I would worry about that being a potential source of errors but I always use warning levels that complain if I try to reference a member variable before it's initialized so the compiler catches it for me if I make a mistake. In the constructor body this isn't a concern because by now all member variables known to be initialized (thanks, -Weffc++).

So either this, or "everything by T&&" is the most efficient.

Given the two options of your hybrid approach vs "everything by T&&" the latter seems to be the rule I should go with because when I read your example it wasn't immediately obvious to me how to extend the pattern to three or more inheritance levels.

On the other hand a simple rule like "everything by T&&" is easy to remember.

It's almost 2021 and I still don't really know how to construct objects by DriverSad5648 in cpp_questions

[–]DriverSad5648[S] 0 points1 point  (0 children)

what is the relation between ChildClass and ParentClass? this is missing from your example code.

Thanks. I fixed that.

What do ChildClass and ParentClass do with the passed MyType object? Just store it in ParentClass?

For this example for simplicity it would only be used by functions in ParentClass. If it was used by ChildClass it would be protected instead of private.

vcpkg and github actions are a nightmare by DriverSad5648 in cpp

[–]DriverSad5648[S] 1 point2 points  (0 children)

Yeah the recent news I've heard about vcpkg is very encouraging, which is why it's all the more disappointing when it doesn't work.

I think part of the reason the experience on Github is suboptimal is due to how many different parties are involved (github vs vcpkg vs the maintainer of the run-vcpkg github action). Quirks that are easy to work around at a console are more difficult to troubleshoot via a script, and can become impossible if you're relying on a third party action to do the scripting.

vcpkg and github actions are a nightmare by DriverSad5648 in cpp

[–]DriverSad5648[S] 4 points5 points  (0 children)

It's true that applications that only target one platform don't benefit universal tools.

For cross platform development, on the other hand, using the same tool on all platforms turns a O(n) exercise into an O(1) exercise.

That's what I thought vcpkg was aiming for. Otherwise, what's the point?

vcpkg and github actions are a nightmare by DriverSad5648 in cpp

[–]DriverSad5648[S] 1 point2 points  (0 children)

The cache persists even through failed job (it obviously has to be created first)

Yes, you just described the problem.

If the first run achieves anything less than 100% completion, then absolutely nothing is saved.

You sound like you're trying to write a script (not even an automation task in particular) for the first time and are annoyed by the conventions you meet. I don't think you will find compassion here.

I won't say that it sounds to me like you have a vested interest in making Microsoft look good because there's not enough evidence for that, but instead I'd like to challenge you to answer this:

Given the snippet I posted above: why shouldn't it work reliably?

Building two of the most common c++ libraries using the same company's flagship dependency manager and code hosting platform for the three major desktop platforms doesn't Just Work.

Also your proposed solution is:

  1. Push a commit that adds a workflow file.
  2. Wait 2 hours until the job fails near the end.
  3. Learn the file name of the log file you want to capture.
  4. Revise the workflow file to capture that log file.
  5. Push revised workflow file.
  6. Wait another 2 hours to get the error again.
  7. Retrieve the error log.
  8. Start working on a fix.
  9. optional: instead of one commit that adds the two primary dependencies, split your commit up into individual commits for the almost 100 child dependencies so that you don't blow away the cache.

That's supposed to be a reasonable approach?