Skip to content

Commit

Permalink
Allow implicit conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernthedev committed Jan 25, 2024
1 parent b81f3c5 commit 44bdb89
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
11 changes: 9 additions & 2 deletions qpm.shared.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"config": {
"version": "0.1.0",
"sharedDir": "shared",
"dependenciesDir": "extern",
"info": {
Expand All @@ -9,13 +10,19 @@
"url": "https://github.com/Fernthedev/paperlog",
"additionalData": {
"overrideSoName": "libpaperlog.so",
"cmake": true
"cmake": false
}
},
"workspace": {
"scripts": {
"build": [
"pwsh ./build.ps1"
"pwsh ./scripts/build.ps1"
],
"copy": [
"pwsh ./scripts/copy.ps1"
],
"qmod": [
"pwsh ./scripts/createqmod.ps1 $0"
]
}
},
Expand Down
6 changes: 6 additions & 0 deletions shared/logger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <chrono>
#include <fmt/core.h>
#include <thread>
#include <type_traits>
#include "log_level.hpp"
#include "internal_logger.hpp"

Expand Down Expand Up @@ -262,6 +263,11 @@ template <std::size_t sz> struct ConstLoggerContext : public BaseLoggerContext<c

struct LoggerContext : public BaseLoggerContext<std::string> {
explicit LoggerContext(std::string_view s) : BaseLoggerContext<std::string>(std::string(s)) {}

// allow implicit conversion
template <typename U>
requires(std::is_constructible_v<std::string, U>)
LoggerContext(BaseLoggerContext<U> const& s) : BaseLoggerContext<std::string>(s.tag) {}
};

namespace Logger {
Expand Down
15 changes: 11 additions & 4 deletions src_bootstrapper/scotland2/qpm.shared.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"config": {
"version": "0.1.0",
"sharedDir": "shared",
"dependenciesDir": "extern",
"info": {
Expand All @@ -8,10 +9,13 @@
"version": "0.1.0",
"url": null,
"additionalData": {
"overrideSoName": "libpaperlog_sl2.so",
"cmake": false
}
},
"workspace": null,
"workspace": {
"scripts": {}
},
"dependencies": [
{
"id": "scotland2",
Expand All @@ -24,12 +28,15 @@
{
"dependency": {
"id": "scotland2",
"versionRange": "=0.1.2",
"versionRange": "=0.1.3",
"additionalData": {
"overrideSoName": "libsl2.so"
"soLink": "https://github.com/sc2ad/scotland2/releases/download/v0.1.3/libsl2.so",
"debugSoLink": "https://github.com/sc2ad/scotland2/releases/download/v0.1.3/debug_libsl2.so",
"overrideSoName": "libsl2.so",
"branchName": "version/v0_1_3"
}
},
"version": "0.1.2"
"version": "0.1.3"
}
]
}

0 comments on commit 44bdb89

Please sign in to comment.