Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8112349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:28:12+00:00 2026-06-06T02:28:12+00:00

In my small project I’m using System.Reflection classes to produce executable code. I need

  • 0

In my small project I’m using System.Reflection classes to produce executable code. I need to call the + operator of a custom type. Does anybody know how can I call customized operator of custom class using C# reflection?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T02:28:13+00:00Added an answer on June 6, 2026 at 2:28 am

    C# compiler converts overloaded operator to functions with name op_XXXX where XXXX is the operation. For example, operator + is compiled as op_Addition.

    Here is the full list of overloadable operators and their respective method names:

    ┌──────────────────────────┬───────────────────────┬──────────────────────────┐
    │         Operator         │      Method Name      │       Description        │
    ├──────────────────────────┼───────────────────────┼──────────────────────────┤
    │ operator +               │ op_UnaryPlus          │ Unary                    │
    │ operator -               │ op_UnaryNegation      │ Unary                    │
    │ operator ++              │ op_Increment          │ Unary                    │
    │ operator --              │ op_Decrement          │ Unary                    │
    │ operator !               │ op_LogicalNot         │ Unary                    │
    │ operator +               │ op_Addition           │                          │
    │ operator -               │ op_Subtraction        │                          │
    │ operator *               │ op_Multiply           │                          │
    │ operator /               │ op_Division           │                          │
    │ operator &               │ op_BitwiseAnd         │                          │
    │ operator |               │ op_BitwiseOr          │                          │
    │ operator ^               │ op_ExclusiveOr        │                          │
    │ operator ~               │ op_OnesComplement     │ Unary                    │
    │ operator ==              │ op_Equality           │                          │
    │ operator !=              │ op_Inequality         │                          │
    │ operator <               │ op_LessThan           │                          │
    │ operator >               │ op_GreaterThan        │                          │
    │ operator <=              │ op_LessThanOrEqual    │                          │
    │ operator >=              │ op_GreaterThanOrEqual │                          │
    │ operator <<              │ op_LeftShift          │                          │
    │ operator >>              │ op_RightShift         │                          │
    │ operator %               │ op_Modulus            │                          │
    │ implicit operator <type> │ op_Implicit           │ Implicit type conversion │
    │ explicit operator <type> │ op_Explicit           │ Explicit type conversion │
    │ operator true            │ op_True               │                          │
    │ operator false           │ op_False              │                          │
    └──────────────────────────┴───────────────────────┴──────────────────────────┘
    

    So to retrieve the operator+ method of the DateTime struct, you need to write:

    MethodInfo mi = typeof(DateTime).GetMethod("op_Addition",
        BindingFlags.Static | BindingFlags.Public );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing a small project using JPA. I need to insert the employee
I get a small project to do on scoring system. I found out that
I have a small project that I was using node-dirty for, but it's not
I have done small project in c++, the IDE I am using is Visual
I have a C++ small project using GNU Make. I'd like to be able
In a small project of mine I've came across the need of a collapsible
I am developing a small project using Java Swing. I am using jdk 7
For a small project that I'm working on I need to create a Windows
I have a small project where I need just part of boost library, boost::regex
Im doing a small project in C++ in LINUX PLATFORM.i need to search 10

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.