boxing Questions
5
Solved
I want to get this structure:
CGPoint addLines1[] =
{
CGPointMake(30.0, 150.0),
CGPointMake(41.67, 145.19),
CGPointMake(53.33, 103.25),
CGPointMake(65.0, 131.67),
CGPointMake(76.67, 106.11),
...
Ineligible asked 3/6, 2009 at 10:4
2
Solved
lets say, i have the following code in c#
int x = 0;
x.ToString();
does this internally does a boxing of x?
Is there a way to see this happening from visual studio?
Ormuz asked 4/9, 2013 at 13:46
6
Solved
My boss forbids me to use var as it would cause boxing and slowing down the app.
Is that true?
Reserve asked 24/8, 2010 at 10:48
1
Solved
If I comment out my static class this compiles fine. However i'd like to have the static class working so I can use the first commented out line in main. My error is
error CS0314: The type 'T' c...
5
Solved
I'm working on creating my own DI framework that creates delegate factories as a learning exercise. My way of building typed delegates is to use expressions to create a function that calls a static...
Biblioclast asked 12/2, 2010 at 22:3
5
public void DoSomething(params object[] args)
{
// ...
}
The problem with the above signature is that every value-type that will be passed to that method will be boxed implicitly, and this is se...
Didymium asked 11/12, 2009 at 21:28
3
Solved
I would like to create a type in C# with value like semantics. It is immutable and it has a low memory footprint. However, it is mostly going to be accessed via an interface it implements. In this ...
2
Solved
In my mind this is what I think of as boxing and unboxing. Nothing more. Can someone confirm that this is correct?
1
Solved
In Scala 2.10, is someDouble.isNaN expected to box? Running my code calling .isNaN through a decompiler, I still see telltale calls to double2Double in my code. Given the new AnyVal work in 2.10, I...
Zaragoza asked 19/4, 2013 at 19:36
2
Solved
I came across this while doing some benchmarking.
bool b;
MyStruct s;
for (int i = 0; i < 10000000; i++)
{
b = (object)s == null;
}
Debug: 200 ms
Release: 5 ms
bool b;
MyStruct? s =...
Ketchup asked 16/4, 2013 at 11:8
5
Solved
I'm trying to collect all of the situations in which boxing occurs in C#:
Converting value type to System.Object type:
struct S { }
object box = new S();
Converting value type to System.ValueT...
Aurore asked 3/11, 2011 at 13:22
3
In Java there is no operator overriding like i C++ so I can't figure out how to implement a boxing/unboxing for my own class.
For example it's possibile to use boxing and unboxing with Integer or ...
3
Solved
Class Integer has cache, which caches the Integer values. So if I use method valueOf or inboxing the new value will not be instantiated, but get from the cache.
I know that the default cache size ...
6
Solved
In C#, any user-defined struct is automatically a subclass of System.Struct System.ValueType and System.Struct System.ValueType is a subclass of System.Object.
But when we assign some struct to ob...
3
Solved
Lately I've written a project in Java and noticed a very strange feature with double/Double implementation. The double type in Java has two 0's, i.e. 0.0 and -0.0 (signed zero's). The strange thing...
7
Solved
I have an interface IEntity
public interface IEntity{
bool Validate();
}
And I have a class Employee which implements this interface
public class Employee : IEntity{
public bool Validate(){ r...
7
Solved
I have an interface IEntity
public interface IEntity{
bool Validate();
}
And I have a class Employee which implements this interface
public class Employee : IEntity{
public bool Validate(){ r...
6
Solved
Case 1
static void call(Integer i) {
System.out.println("hi" + i);
}
static void call(int i) {
System.out.println("hello" + i);
}
public static void main(String... args) {
call(10);
}
Outpu...
Ordinand asked 27/12, 2012 at 11:2
4
Solved
I am little bit confused in boxing and unboxing. According to its definition
Boxing is implicit conversion of ValueTypes to Reference Types (Object).
UnBoxing is explicit conversion of Referenc...
2
Solved
Background: I'm developing for the xbox and am at the optomising stage. I need to cut down on object allocations. One place to start is finding out where (un)boxing occurs.
I'm very new to IL (in ...
Goldi asked 20/6, 2011 at 20:11
2
Solved
Below is some quick code to illustrate my question. Any way to avoid this apparently unnecessary boxing/unboxing?
public class TestClass<T>
{
public T TestMethod()
{
if (typeof(T) == type...
2
Solved
I'm using Clang's primitive-boxing feature to pack an enumeration member into NSNumber
The Boxed Enums section of the Clang doc about this says that the compiler boxes enumeration members into int...
Florinda asked 22/8, 2012 at 10:32
3
Solved
For a numeric intensive code I have written a function with the following signature:
def update( f: (Int,Int,Double) => Double ): Unit = {...}
However, because Function3 is not specialized, e...
4
Solved
As we know, int has ToString() method which override the ToString() method of base type Object.
For this following code,
int x = 100;
object y = (object)x;
Console.Write(y.ToString());
(1) Whos...
2
Solved
Normally, one would expect, and hope, that two casts are needed to first unbox a value type and then perform some kind of value type conversion into another value type. Here's an example where this...
Clearcut asked 13/7, 2012 at 14:4
© 2022 - 2024 — McMap. All rights reserved.