Re: Fastest way to check if the bottom-class of a class reference is any of a set of classes
On Monday, 16 December 2019 at 18:01:06 UTC, Steven Schveighoffer wrote: I'd compare the typeid directly: auto tid = typeid(object); return(tid is typeid(X) || tid is typeid(Y) || tid is typeid(Z) || ...) If you are doing a cast(const(X))object, what you are doing is each time traversing the linked-list of typeids anyway doing the same as the above, but doing extra work. So this should be faster. -Steve Great. Thanks. Because we're only interested in non-abstract classes I adjusted your code to static foreach (Type; AliasSeq!(...)) { static assert(!__traits(isAbstractClass, Type)); if (zingid is typeid(Type)) { return true; } }
Re: DUB copyFiles for subPackages
copyFiles in subPackage finds file correct, so changing it gives "file not found". Also subPackage builds into "targetPath": "/template" as expected. But copyFiles uses "targetPath": "/build" instead of using it's local "targetPath": "/template". I just assumed if targetPath has been set in subPackage then all commands for this package should use its targetPath config as a destination folder if there somebody of dub distributors please check is it a bug?
Re: DUB copyFiles for subPackages
On Tuesday, 17 December 2019 at 13:03:17 UTC, Dmitriy wrote: { ... "configurations": [ { ... "targetPath": "/build", "copyFiles": [ "/template" ], "dependencies": { "package": { "path": "./source/package" } }, "subPackages": [ { "name": "package", "sourcePaths": ["/source/package"], "importPaths": ["/source/package"], "targetPath": "/template", "targetName": "./package", "copyFiles": [ "some_file" ] } ] } ] } [...] Could you check whether you can use variable $PACKAGE_DIR or $ROOT_PACKAGE_DIR in copyFiles command to specify the correct folder? Kind regards André
DUB copyFiles for subPackages
{ ... "configurations": [ { ... "targetPath": "/build", "copyFiles": [ "/template" ], "dependencies": { "package": { "path": "./source/package" } }, "subPackages": [ { "name": "package", "sourcePaths": ["/source/package"], "importPaths": ["/source/package"], "targetPath": "/template", "targetName": "./package", "copyFiles": [ "some_file" ] } ] } ] } Hello. I have a dub project which contains another one subProject in source dir. I need some files to be copied when subPackage builds. And I expect files to be copied to "targetPath": "/template" of subProject, but it copies to "targetPath": "/build", which is root output project Should copyFiles for subPackage use it's target path
Blog Post #0094: Addressing Hardware
Today's post starts a new series (note the nifty Airport icon) on hardware. We start with an overview, and then look at monitors. You can find it right here: https://gtkdcoding.com/2019/12/17/0094-hardware-i-monitors.html