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 3437340
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:03:11+00:00 2026-05-18T08:03:11+00:00

So Google’s not a good choice for looking up examples for overloaded operators like

  • 0

So Google’s not a good choice for looking up examples for overloaded operators like “And” or “Or”, because it tries to parse them as operators to the search query itself. MSDN also provides no examples of how to implement an overloaded And operator, so I’m not certain how to properly overload it for my project.

Does anyone have an example of “And” at minimum? “Or” or “Xor” (or any others) would be a bonus. I’m not certain if I need to overload these operators in my objects just yet, as I’m still building them out and haven’t planned beyond just yet. But having examples around that might get indexed by Google will probably help save the sanity of a lot of people…

  • 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-05-18T08:03:11+00:00Added an answer on May 18, 2026 at 8:03 am

    You overload the logical operators in the same way that you overload the unary or arithmetic operators.

    I can’t actually think of a case where this would be useful at the moment, but for the sake of example, here’s a sample structure that overrides the And and Or operators:

    Public Structure Foo
    
        Public Shared Operator And(ByVal val1 as Foo, ByVal val2 as Foo) As Foo
            ''#(calculate the logical And of the two specified values here)
            Return New Foo(val1.Bar And val2.Bar, val1.Baz And val2.Baz)
        End Operator
    
        Public Shared Operator Or(ByVal val1 as Foo, ByVal val2 as Foo) As Foo
            ''#(calculate the logical Or of the two specified values here)
            Return New Foo(val1.Bar Or val2.Bar, val1.Baz Or val2.Baz)
        End Operator
    
    End Structure
    

    This MSDN page gives some other examples and further explanation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Google does not allow searching for ! !-f becomes -f What search engines find
Google has indexed certain pages in my website that I wouldn't like users to
Google is useless for these sorts of searches, because you get hundreds of millions
Google's market_billing sample , just like others as this one , connects to the
Google returns Unparsable Cuft to the json response like this: throw 1; <dont be
Google uses very cool SVG-like screenshots for their extensions ( translate , gmail ).
Google Code Search has indexed Subversion and Mercurial repositories, so people can search open
Google does not really deliver much content (or my query sucks). Has anyone made
Google allows you to load jQuery asynchronously like so: <script src=http://www.google.com/jsapi?key=... type=text/javascript></script> <script> //<![CDATA[
Google will now parse certain microdata (for example reviews) on your web pages and

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.