Skip to main content
Filter by
Sorted by
Tagged with
3 votes
2 answers
185 views

I've a C++ concept where I need to check that the class has a particular public attribute. My problem is that the concept works if I use it directly, but fails if I use it in std::visit. This is the ...
Jepessen's user avatar
  • 12.7k
0 votes
1 answer
64 views

I've written the next piece of code in order to declare a vector of lexical elements: type Lexical_Element_Kind is ( Delimiter, -- & ' ( ) * + , - . / : ; < = > | -- => .. ...
tymurmchyk's user avatar
0 votes
0 answers
44 views

I use Spark 4.0 and have the following code from pyspark.sql import SparkSession from pyspark.sql import functions as F from pyspark.sql.types import StringType json_data = [ ('{"auswahl&...
user3579222's user avatar
  • 1,512
1 vote
0 answers
137 views

When I try to convert a pyspark DataFrame with a VariantType column to a pandas DataFrame, the conversion fails with an error 'NoneType' object is not iterable. Am I doing it incorrectly? Sample code: ...
Ghislain Fourny's user avatar
0 votes
0 answers
89 views

I want save a csv file in delta lake table. In that file I have a column user that has the json value that in some rows the structure is different. And in the name I have Farsi character. In delta ...
Tavakoli's user avatar
  • 1,433
2 votes
3 answers
164 views

I want to store objects of different types in a std::set and rely on std::set's sorting to later access them by some key variable which is present in every type. To store different types I am using ...
phinz's user avatar
  • 1,647
0 votes
2 answers
90 views

I'm implementing polymorphism on GPU with std::cuda::variant, so far it's working with Circle, Square, Shape: struct Circle; struct Square; using Shape = cuda::std::variant<Circle, Square>; ...
Rahn's user avatar
  • 5,565
0 votes
0 answers
87 views

I'm trying to set up WSL as a toolchain in CLion. In Settings > Build, Execution, Deployment > Toolchains when I select WSL, the "Toolset" dropdown shows "No variants found", ...
THAZH's user avatar
  • 1
0 votes
3 answers
131 views

I have a lot of polymorphic classes. Each of them has a nested class named Configuration containing all the hyperparameters required by the class. For each class tree, I create a variant of the ...
Caduchon's user avatar
  • 5,278
1 vote
0 answers
26 views

I’m working with the BigCommerce API and need to achieve the following: Create Discount Code for a Variant: Is it possible to create a discount code specifically for a variant (not the whole product), ...
Adith C p's user avatar
0 votes
0 answers
96 views

I have a macro that I use for doing interstore transfers between stores and calculates stock transfers based on certain criteria. It loops through a list of sending stores and evaluates potential ...
Diego Kersjes's user avatar
0 votes
2 answers
68 views

I have a workbook with lots of code in it that I have been using for many years. One of the worksheets has code that is supposed to create and populate a validation list with the names of folder names ...
Eyal Abramowitz's user avatar
1 vote
2 answers
140 views

I'm struggling with an odd behavior of the below code. The problem is that output of this snippet is "double". But we have an int in lhs. I dug for a while and figured out the compiler put a ...
msg's user avatar
  • 166
0 votes
0 answers
103 views

I am using a C++ std::variant with around 100 structs as possible choices. This type is used throughout my application and compile times tend to point to the instantiation and generation of various ...
yano's user avatar
  • 4,523
2 votes
2 answers
278 views

I have a std::variant of possibly repeated types, and I would like to increment the active index of the variant. Here is an example demonstrating what I would like to do: template <typename... Ts&...
Bernard's user avatar
  • 5,800
1 vote
1 answer
122 views

I am trying to migrate a Delphi 6 application with TdxDBGrid to Delphi 2009, and for the time being I would like to keep TdxDBGrid, because it has features that TcxGrid does not (we're moving to ...
TomR's user avatar
  • 3,364
0 votes
1 answer
118 views

Having an issue where on this 2 variant product, the 100ml option when clicked should bring up Buy at Macy's. It only does if you go to the URL with the variant hard coded in. This is my current ...
Adam Bell's user avatar
  • 1,045
3 votes
2 answers
120 views

I'm given a std::variant of several types. I would like to write a trait that gives another std::variant of the pointer of the types of the first. using MyVariant = std::variant<int, float>; ...
MaPo's user avatar
  • 887
10 votes
1 answer
215 views

Consider following code: #include <variant> class A {}; class B {}; template<typename... Ts, typename Variant> bool constexpr is_of(const Variant& variant) { return std::visit( ...
pasbi's user avatar
  • 2,191
3 votes
1 answer
82 views

I'm trying to understand construction of std::variant<Ts...> by giving it a value from which one of its Ts can be constructed. The reference says std::variant<Types...>::variant ... (4) ...
igel's user avatar
  • 556
2 votes
2 answers
180 views

I am playing around with C++ and faced this problem. If I have a variant that looks like this: using Fruit = variant<Apple, Tomato> and a vector of unique_ptr of Fruit: vector<unique_ptr<...
HiddenPasta's user avatar
0 votes
0 answers
43 views

Here is the code from a gnome extension: try { log(``); global.set_persistent_state('int_val', GLib.Variant.new_int16(0)); let state = global.get_persistent_state('n', 'int_val').get_int16(...
Ahmad Ismail's user avatar
  • 14.5k
1 vote
3 answers
156 views

I need to convert variant<type1, type2, ...> to another variant<ftype1, ftype2, ...> where ftypeN is the return type of function fn() invoked with parameter of typeN, subject to the ...
Gene's user avatar
  • 754
2 votes
4 answers
191 views

I need to access a value in std::tuple by index at run time. For that purpose I wrote a function that returns a std::variant with the same types initialized for the specified index. Implementation ...
Gene's user avatar
  • 754
2 votes
0 answers
22 views

I am trying to run a tool ("TAPES") for ACMG-based variant prioritization of a vep-annotated VCF file. The tool works perfect with the toy_dataset that contains another vep-annotated vcf ...
Manny2412's user avatar
1 vote
1 answer
605 views

I'm trying to run the snowflake copy into command using a snowflake staged CSV file. my command looks like this COPY INTO test_table FROM @my_stage FILE_FORMAT = (TYPE = CSV SKIP_HEADER = 1) PURGE = ...
Sitruc's user avatar
  • 51
1 vote
1 answer
88 views

In my simulation engine, I have a SimulationObject template that I specialize for different type of SimulationObjects using a Tag. I also have a SimulationObjects type that lists all the ...
jjcasmar's user avatar
  • 1,757
2 votes
2 answers
139 views

I have a template class that takes std::variant as a template parameter: template<class T> class X { }; X<std::variant<int, float>> x; I want to add a constraint for T to be ...
hopeless-programmer's user avatar
2 votes
1 answer
99 views

When using just pointers/references to std::variant<T...> defined from T... where some of T is only forward declared - I have this problem that I cannot even use pointers nor references to this ...
PiotrNycz's user avatar
  • 25.1k
0 votes
1 answer
120 views

For this code: struct A {}; struct B {}; auto f() -> std::variant<A, B> { if (true) return A(); return B(); } Is it possible for a compiler to automatically deduce return type as ...
hopeless-programmer's user avatar
0 votes
0 answers
262 views

I need some better understanding of records stored in VARIANT. If there is a VT_RECORD typed variant, it has the following structure (in 32-bit): V->vt = VT_RECORD V->DATA1 //(8 byte offset) ...
René Rössler's user avatar
1 vote
2 answers
470 views

I'm trying to implement std::variant wrapper that would behave similarly to std::variant when it comes to assignment and creation but also allow implicit cast to all alternatives held by the variant. ...
Zax Ftw's user avatar
  • 103
1 vote
2 answers
140 views

I found the following code (by phoeen) instanciating a variant based on index at runtime: template <typename... Ts> std::variant<Ts...> make_variant(std::size_t i) { assert(i < ...
Caduchon's user avatar
  • 5,278
0 votes
1 answer
73 views

I am attempting to retrieve the value stored in a return variable with a type of variant, but I am struggling to make it work. Do you have any ideas? :) I've tried almost everything, including ...
Svatos's user avatar
  • 43
3 votes
1 answer
75 views

I wrote an XLL library to provide some functions written with the Excel C API. When I return an array (as a xloper12 type xltypeMulti), I notice a strange behaviour. If the function returns an array n ...
Giancarlo Pfeifer's user avatar
-1 votes
1 answer
288 views

Why does the VBA compiler require For Each iterators to be of type Variant? For example, this code will throw error: Public Sub IterationTest() Dim arr(1 To 4) As String Dim str As String arr(1) = &...
KundaliniSin's user avatar
0 votes
1 answer
88 views

I have a template class that contains mutex and cv. I want to create different versions of this class and store it in a map with a enum key. Template class given as; // A threadsafe-queue. template &...
BlueGreenRed's user avatar
-1 votes
1 answer
114 views

#include <optional> #include <variant> #include <vector> // A static_assert( std::optional< std::vector< int > >{ std::vector< int >{ 1, 2, 3 } } );...
Arjan's user avatar
  • 490
1 vote
1 answer
91 views

How do I access a uint64 in a VARIANT structure? Eg: VARIANT vtProp{}; hres = pclsObj->Get(L"FreeSpaceInPagingFiles", 0, &vtProp, 0, 0); strSystemInfo.AppendFormat(L" Free Space ...
Andrew Truckle's user avatar
0 votes
1 answer
88 views

I'm working on a particular problem wherein I have to read multiple columns from a "sheet" in "file". These columns are to be temporarily stored in a "fileArray" and ...
Sunny Pagdiwala's user avatar
-1 votes
1 answer
147 views

I have a std::variant whose alternatives are all pointers. class a { public: int* placeholder; a(a& _copy) { /* Does a deep copy */ } } class b { // For demonstrational purposes, ...
Stressed 's user avatar
0 votes
1 answer
631 views

I used bcftools merge to merge 2 VCF files, however, when I see the merged VCF file, I don't see the updated fields. Suppose if I am running 2 samples in 1 VCF file which are different and 2 samples ...
Prachi's user avatar
  • 19
2 votes
1 answer
102 views

I wrote the following program that works with msvc c++17 but rejected by gcc and clang. I want to know which compiler is right here. Demo. #include <variant> struct C { std::variant<bool&...
user avatar
0 votes
0 answers
26 views

I would like to import Android dependencies in the gradle build file and I would like define a version for all my environnement build variant. Then I would like get this version to display it in my ...
Dev Loots's user avatar
  • 838
0 votes
2 answers
57 views

I am trying to write a UDF that takes either a range or an array from the user and iterates over it. If I declare it as a range like so: Function Test(param As Range) As Variant Dim total As ...
Sam_W's user avatar
  • 69
0 votes
2 answers
285 views

This is my struct which uses implicit casting on creating variable. #include <string> #include <variant> using namespace std; using val = variant<int, string, double, bool, long, long ...
Make Mutistico's user avatar
1 vote
1 answer
145 views

---- updated ------------------------------------------- At first, I think that the problem I faced is trivially_copyable. In fact, even I give up making it trivially_copyable, it still can NOT be ...
Leon's user avatar
  • 2,165
1 vote
0 answers
106 views

In a ClientDataSearch using Lookup, we're told that to determine if Lookup found an entry is to check whether the returned variant is null (VarIsNull). This appear to NOT be correct if the field we ...
Kevin Killion's user avatar
4 votes
0 answers
218 views

I wrote some code and with optimizer -O2 I got a lot of warnings while running with -O3 is silent! Also gcc trunk ( godbolt) compiles without warnings. Compiler/library bug or simply my code is wrong? ...
Klaus's user avatar
  • 26k
0 votes
1 answer
108 views

I need to transform some values in a variant column. 'eng' to 'english', 'sp' to 'spanish', 'un' to 'unknown' Source Data: Target Data: CREATE OR REPLACE TABLE driver_info ( ID INTEGER, ...
BeginnerDeveloper's user avatar

1
2 3 4 5
26