Is there an additional runtime cost for using named parameters?

Posted by Jurily on Stack Overflow See other posts from Stack Overflow or by Jurily
Published on 2010-05-21T10:23:31Z Indexed on 2010/05/21 10:30 UTC
Read the original article Hit count: 199

Filed under:

Consider the following struct:

    public struct vip
    {
        string email;
        string name;
        int category;

        public vip(string email, int category, string name = "")
        {
            this.email = email;
            this.name = name;
            this.category = category;
        }
    }

Is there a performance difference between the following two calls?

var e = new vip(email: "foo", name: "bar", category: 32);

var e = new vip("foo", 32, "bar");

Is there a difference if there are no optional parameters defined?

© Stack Overflow or respective owner

Related posts about c#4.0