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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:12:27+00:00 2026-06-14T10:12:27+00:00

I get a Decorated name length exceeded warning from my code I’ve looked at

  • 0

I get a “Decorated name length exceeded” warning from my code I’ve looked at the SO answers to similar questions. *N.B. I know how to turn this off (pragma), I also know that it is a warning I can “ignore” and that unix based compilers may not emit it 😛 *

There is a practical element to this question , If I get errors I do have to wade through some pretty horrendous text and templates. These errors are mostly due to typos currently, but if I had anything subtle it would be a nightmare to actually find what the issue is.

My code compiles and works, but as I said above I get a warning. I have a “relatively” small expression

...
auto expression = (l,aComma,w,aComma,x,aComma,y,aComma,z);
std::cout << expression;

that I generate from a comma operator I have defined for my expression template (I can post if required but trying to keep this minimal – Pretty standard stuff copied):

//
//Expression 
//
template < class E >
struct Expr 
{
    E expr_;
    Expr (E e) : expr_ (e) {}
    std::ostream& print(std::ostream& out) { return expr_.print(out); }
};

template < class L, class H, class OP >
struct BinExpr 
{
    L l_;
    H h_;
    BinExpr (L l, H h) : l_ (l), h_ (h) {}
    std::ostream& print(std::ostream& out) { l_.print(out) ; return h_.print(out); }
};

template< class A, class B >
Expr< BinExpr< Expr<A>, Expr<B>, Print<Expr<A>,Expr<B> > > > 
operator , ( Expr<A> a, Expr<B> b )
{
    typedef BinExpr < Expr<A>, Expr<B>, Print<Expr<A>,Expr<B> > > ExprT;
    return Expr<ExprT>(ExprT(a,b));
}

The Microsoft page talks about refactoring to avoid this warning. MS wraps each level in a plain struct which then contains a templated element member. The problem with that is that the whole point in writing the expression template is to use implicit construction to create the tree of objects required, avoiding having to define exactly what I will be creating before hand. So…

  • The Question I want to ask is whether I can somehow typedef the length down without losing function and flexibility?

  • Or, can I somehow use the Microsoft suggestion to wrap parts of the structures, again , without losing function and flexibility? I can do that for the types I am going to use in the Expr objects as I will be setting them up before “listing” them in between the commas. But the length will grow as I add more items and so it will probably hit this limit again. I’ll also be adding more complexity to this as I add new function. These will be similarly created and so most likely generate more headaches…

  • Are there any features of C++11 that I could use to help? I tried a trailing return type but the internal typedef was not in effect (and I’m not sure it would have helped).


  • 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-14T10:12:28+00:00Added an answer on June 14, 2026 at 10:12 am

    Whenever I have encountered this warning and looked in to refactoring the code so that the warning is not emitted, I found in every case that refactoring was impossible. If I didn’t need all those template parameters, I wouldn’t have had them there in the first place.

    The MS page also says:

    The correctness of the program, however, is unaffected by the
    truncated name.

    Based on this fact, my SOP is to #pragma the warning away:

    #pragma warning( disable: 4503 )

    This solution is a bit like an atomic bomb, I admit. However this is the only instance in which I will actually ignore a compiler warning on any level, and I believe it can be safely ignored.

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

Sidebar

Related Questions

Get class from div inside an li and add to the same li. The
I get Compiler Error C2248 when i try to compile the following code: #include
When writing a custom channel how can I get the name of the service
I have my model field decorated in the following way: [DataType(DataType.Date)] [Display(Name = Date
I have this code in a JavaScript function: var url = '@Url.Action(MVC.Membership.User.ActionNames.Update, MVC.Membership.User.Name)'; url
In C++, when we use typeid to get type name of an object or
i have a type class Foo { public string Name { get; set; }
Is the Decorator Pattern mainly to get an object with dynamically chosen extra functionalities?
//Get width and resize another element $(document).ready(function() { function ResizeSearch(GridID, SearchID) { var eleWidth
get an array of bluetooth ID's Broadcast the bluetooth signal manually

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.