variant Questions
2
Solved
I hit the limit of 50 types in boost::variant. I found this nice self-contained header but it lacks the multi visitation feature (I actually need the double visitation).
I tried to look a bit afte...
Racoon asked 4/6, 2014 at 16:28
1
I'm attempting to call RNGCryptoServiceProvider->GetBytes() from PHP via the COM layer. I can get it to connect to the class, but every time I call the method, I get one of two errors (relating to ...
1
Solved
I am trying to take a variant variable and convert it into a string so that I can run a split function on the data. However, whenever I try to redefine the variant I get a type mismatch error. I ha...
4
Solved
Here's the problem:
I am currently trying to create a simple stack-based programming language (Reverse Polish Notation, FORTH style) as a component of a larger project. I have hit a snag, though.
...
2
Solved
I'm trying to get rid of dependencies on SCRRUN.DLL in a VB6 application. One of the things it's currently being used for is its Dictionary class. The Dictionary class has a Keys function that is s...
1
Solved
I think Boost::variant is busted in 1_54.
I am trying to use a std::unique_ptr with as a bounded type in boost variant.
According to the 1_54 documentation, variant needs to be copy constructable...
5
Solved
There is no direct support for variant types (aka tagged unions, discriminated unions) in C#. However one can go with a visitor pattern that enables discrimination via double-dispatching and guaran...
Washcloth asked 14/10, 2013 at 1:40
1
I'm trying to write overloads of operator<< for specific instantiations of standard library containers that will be stored in a boost::variant. Here's a small example that illustrates the pro...
Lajoie asked 15/9, 2013 at 20:34
1
Solved
I have an object, that has one value, but that value can either be an integer, string, boolean or TDateTime. So, it is a Variant.
I use VarType() to check its type, but since VarType() has no 'var...
1
Solved
uses
SysUtils, Variants;
var
VariantSingle: Variant;
VTSingle: TVarType;
SingleTest: Single;
VariantDouble: Variant;
DoubleTest: Double;
VTDouble: TVarType;
begin
SingleTest := 1.234;
Va...
2
A leak checker tells me that I have a memory leak on memory that is allocated in the following code:
// Get the value from the object as a variant.
VARIANT vVal;
VariantInit ( &vVal );
hres = ...
Smail asked 9/1, 2013 at 19:56
2
Solved
I have this current code, which types "AAPL" into an excel sheet, and the returns the corresponding value.
I would like to make it so that after cout << "Ticker: "; i can type in a ticker s...
Wingate asked 25/12, 2012 at 23:29
5
Solved
Type inference makes use of the var keyword. The compiler "infers" what the type of the variable is by what the variable is initialized to.
e.g. var somenum=o;
becomes int somenum=0;
Even though s...
1
i am trying to call a method of COM object, where one of the documented parameters is an "array of bytes". The actual declartion depends on the per-language documentation you're looking at:
in C#...
1
Solved
So I am working on an Excel Project that is going to load a C++ dll using VBA. What I'd like to do is to be able to pass an Excel range with no specific type (data can be numerical or categorical) ...
3
Solved
OCaml gives function `A -> 1 | _ -> 0 the type [> `A] -> int, but why isn't that [> ] -> int?
This is my reasoning:
function `B -> 0 has type [<`B] -> int. Adding a `A...
Kutzer asked 26/5, 2012 at 19:6
1
Solved
I have a TDateTime value (that I get as result from EndOfTheMonth(date)) to a variant type. The result is wrongly rounded. Let's have a look at example:
data := EndOfTheMonth(date);
V := data;
...
Efferent asked 5/4, 2012 at 11:32
2
Solved
I am trying to convert the following two interfaces from a C header file to a Delphi PAS unit but have run into strange problems when using the ones I did myself. I need help understanding how to i...
Leaven asked 18/3, 2012 at 10:2
1
Solved
I have such code:
boost::variant<b2DistanceJointDef, b2FrictionJointDef,
b2GearJointDef, b2MouseJointDef, b2PrismaticJointDef, b2PulleyJointDef,
b2RevoluteJointDef, b2RopeJointDef, b2WeldJoin...
4
I have a large VB6 projects where a lot of variables don't have an explicitly defined type, so they automaticly default to Variant type. Finding all those by hand is a massive task, so is there any...
Enyo asked 19/1, 2012 at 13:0
4
I am designing a communication middleware for use in an application which has a module in Ada and many modules in C++ which communicates passing parameters (scalar values) and structures. The appli...
1
1) I have an open union defined as follows:
type 'a choice = [> `One | `Other ] as 'a
I then try to define a type choice_list:
type choice_list = choice list
which does not work. How does ...
2
Why does this work fine?
module Account = struct
type account_type = Current of float | Savings of float
end
let sarah = Account.Current 100.0;;
While the final line in the following produce...
4
Solved
here is a snippet showing what I am trying to achieve:
type
TMyObject<T> = class (TObject)
function GetVarType(Value: T): TVarType;
end;
function TMyObject<T>.GetVarType(Value: T)...
Tarlatan asked 25/10, 2011 at 15:55
2
Solved
© 2022 - 2024 — McMap. All rights reserved.