Top "Value-type" questions

In computer science, the term value type is commonly used to refer to one of two kinds of data types: Types of values or Types of objects with deep copy semantics.

In C#, why can't I modify the member of a value type instance in a foreach loop?

I know that value types should be immutable, but that's just a suggestion, not a rule, right? So why can't …

c# foreach immutability value-type
Test if an object is an Enum

I would like to know if 'theObject' is an enum (of any enum type) foreach (var item in Enum.GetValues(…

c# enums value-type
How to make a value type nullable with .NET XmlSerializer?

Let's suppose I have this object: [Serializable] public class MyClass { public int Age { get; set; } public int MyClassB { get; set; } } […

c# xml-serialization null value-type
Enum is Reference Type or Value Type?

I used Enum property in my EntityFramework 5 class, but in the database this field is nullable. Visual studio gives the …

.net enums value-type reference-type
AnyObject and Any in Swift

I don't understand when to use AnyObject and when to use Any in Swift. In my case, I've a Dictionary […

swift value-type reference-type
C# Generic constraints to include value types AND strings

I'm trying to write an extension method on IEnumerable that will only apply to value types and strings. public static …

c# string generics constraints value-type
How to store a reference to an integer in C#?

Possible Duplicate: How do I assign by “reference” to a class field in c#? Hello everyone - tell me how …

c# reference value-type
Returning two values, Tuple vs 'out' vs 'struct'

Consider a function which returns two values. We can write: // Using out: string MyFunction(string input, out int count) // Using …

c# struct tuples out value-type
Can AutoMapper Map Between a Value Type (Enum) and Reference Type? (string)

Weird problem - i'm trying to map between an enum and a string, using AutoMapper: Mapper.CreateMap<MyEnum, string&…

c# enums automapper value-type reference-type
C#, Copy one bool to another (by ref, not val)

I am at a brick wall here. Is it possible to copy one bool to the ref of another. Consider …

c# .net value-type reference-type