Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / March 2005

Tip: Looking for answers? Try searching our database.

Location of template instantiation when I get a template compile error?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Frank Vanris - 29 Mar 2005 00:13 GMT
Hi,

I am using boost which uses templates heavily. When I make a typo the
compiler complains, but it complains in the boost headerfile (I attached an
example at the end where I forgot to pass in a parameter). But what I
actually need to know is where this template was instantiated so that I can
fix my typo. Is there an option so that the compiler tells me the location
of instantiation?

Thanks,
Frank.

Example of compile error:

C:\Frank\Develop\boost_1_32_0\boost\lambda\detail\actions.hpp(96): error
C2780: 'void boost::lambda::function_adaptor<Func>::apply(Result (__thiscall
FVUtil::FVHtmlRules::* )(Arg1,Arg2) const,const Object &,A1 &,A2 &)' :
expects 4 arguments - 3 provided
       with
       [
           Func=boost::lambda::return_type_N<boost::lambda::function_action<3>,boost::lambda::lambda_functor_base<boost::lambda::action<3,boost::lambda::function_action<3>>,boost::tuples::tuple<const
boost::lambda::detail::bind_traits<void (__thiscall FVUtil::FVHtmlRules::*
const )(FVUtil::FVHtmlTags,const char *) const>::type,const
boost::lambda::detail::bind_traits<const FVUtil::FVHtmlRules *const
>::type,const boost::lambda::detail::bind_traits<const
FVUtil::FVHtmlTags>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type,boost::lambda::detail::bind_traits<boost::tuples::null_type>::type>>::sig<boost::tuples::null_type>::rets_t>::plain_Func
,
           Result=void,
           Arg1=FVUtil::FVHtmlTags,
           Arg2=const char *,
           Object=FVUtil::FVHtmlRules
       ]
Carl Daniel [VC++ MVP] - 29 Mar 2005 00:32 GMT
> Hi,
>
[quoted text clipped - 5 lines]
> I can fix my typo. Is there an option so that the compiler tells me the
> location of instantiation?

It does - just read back through the detail messages until you come to code
that you wrote.  If you never come to code that you wrote, it's a lot harder
to figure out what's wrong.

Was the example you posted the complete error message?

-cd
Frank - 29 Mar 2005 03:33 GMT
I never see code I wrote, and indeed it is very hard to find out where I
made the mistake. I make micro changes so that I at least know in what area I
have to look if I get a compiler error.

The example was the complete error message. As I said, fortunately I made
microchanges so I was able to figure out that it came from the following line:

_preFormattedText = _preformattedTextKeyword[bind(&FVHtmlRules::processTag,
&self, FVHTML_TEXT)];

My change was that I added a parameter to processTag, so I should have
changed this line to

_preFormattedText = _preformattedTextKeyword[bind(&FVHtmlRules::processTag,
&self, FVHTML_TEXT, _1)];

Frank.

> > Hi,
> >
[quoted text clipped - 13 lines]
>
> -cd

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.