Click here to Skip to main content
14,422,431 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
 
RantThanks once again Microsoft, this time for not documenting C#/.NET behavior Pin
honey the codewitch8-Dec-19 5:03
mvahoney the codewitch8-Dec-19 5:03 
GeneralRe: Thanks once again Microsoft, this time for not documenting C#/.NET behavior Pin
OriginalGriff8-Dec-19 5:57
communityengineerOriginalGriff8-Dec-19 5:57 
GeneralRe: Thanks once again Microsoft, this time for not documenting C#/.NET behavior Pin
honey the codewitch8-Dec-19 5:59
mvahoney the codewitch8-Dec-19 5:59 
GeneralRe: Thanks once again Microsoft, this time for not documenting C#/.NET behavior Pin
Afzaal Ahmad Zeeshan8-Dec-19 7:39
mvaAfzaal Ahmad Zeeshan8-Dec-19 7:39 
GeneralRe: Thanks once again Microsoft, this time for not documenting C#/.NET behavior Pin
honey the codewitch8-Dec-19 7:42
mvahoney the codewitch8-Dec-19 7:42 
GeneralRe: Thanks once again Microsoft, this time for not documenting C#/.NET behavior Pin
Sander Rossel8-Dec-19 9:17
professionalSander Rossel8-Dec-19 9:17 
GeneralRe: Thanks once again Microsoft, this time for not documenting C#/.NET behavior Pin
honey the codewitch8-Dec-19 9:18
mvahoney the codewitch8-Dec-19 9:18 
GeneralRe: Thanks once again Microsoft, this time for not documenting C#/.NET behavior Pin
Sander Rossel8-Dec-19 9:37
professionalSander Rossel8-Dec-19 9:37 
honey the codewitch wrote:
Or maybe it works in comparisons but not assignments.
I think that's it.
Assignments can't be done, just as new T().

Perhaps you can work around boxing.[^]
public void MyVoid<T>(T something)
{
    if (typeof(T).IsValueType)
    {
        // Not null, so no boxing
    }
    else
    {
        // Nullable, so no boxing
    }
}
Although this is probably not about your code, but code others might possibly write?

GeneralRe: Thanks once again Microsoft, this time for not documenting C#/.NET behavior Pin
honey the codewitch8-Dec-19 9:42
mvahoney the codewitch8-Dec-19 9:42 
GeneralRe: Thanks once again Microsoft, this time for not documenting C#/.NET behavior Pin
Sander Rossel8-Dec-19 10:35
professionalSander Rossel8-Dec-19 10:35 
GeneralRe: Thanks once again Microsoft, this time for not documenting C#/.NET behavior Pin
honey the codewitch8-Dec-19 10:36
mvahoney the codewitch8-Dec-19 10:36 
GeneralRe: Thanks once again Microsoft, this time for not documenting C#/.NET behavior Pin
Sander Rossel8-Dec-19 10:45
professionalSander Rossel8-Dec-19 10:45 
GeneralRe: Thanks once again Microsoft, this time for not documenting C#/.NET behavior Pin
PIEBALDconsult8-Dec-19 9:19
professionalPIEBALDconsult8-Dec-19 9:19 
GeneralRe: Thanks once again Microsoft, this time for not documenting C#/.NET behavior Pin
Dave Kreskowiak8-Dec-19 9:48
mveDave Kreskowiak8-Dec-19 9:48 
GeneralRe: Thanks once again Microsoft, this time for not documenting C#/.NET behavior Pin
honey the codewitch8-Dec-19 9:58
mvahoney the codewitch8-Dec-19 9:58 
GeneralThis is why I don't talk to people... Pin
Sander Rossel8-Dec-19 2:39
professionalSander Rossel8-Dec-19 2:39 
GeneralRe: This is why I don't talk to people... Pin
Cp-Coder8-Dec-19 2:55
MemberCp-Coder8-Dec-19 2:55 
GeneralRe: This is why I don't talk to people... Pin
Sander Rossel8-Dec-19 3:08
professionalSander Rossel8-Dec-19 3:08 
GeneralRe: This is why I don't talk to people... Pin
OriginalGriff8-Dec-19 3:04
communityengineerOriginalGriff8-Dec-19 3:04 
GeneralRe: This is why I don't talk to people... Pin
Sander Rossel8-Dec-19 3:35
professionalSander Rossel8-Dec-19 3:35 
GeneralRe: This is why I don't talk to people... Pin
Nelek8-Dec-19 4:47
protectorNelek8-Dec-19 4:47 
GeneralRe: This is why I don't talk to people... Pin
Sander Rossel8-Dec-19 4:51
professionalSander Rossel8-Dec-19 4:51 
GeneralRe: This is why I don't talk to people... Pin
Nelek8-Dec-19 5:51
protectorNelek8-Dec-19 5:51 
GeneralRe: This is why I don't talk to people... Pin
Cp-Coder8-Dec-19 5:57
MemberCp-Coder8-Dec-19 5:57 
GeneralRe: This is why I don't talk to people... Pin
Nelek8-Dec-19 7:42
protectorNelek8-Dec-19 7:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.