<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Template Argument kann nicht hergeleitet werden]]></title><description><![CDATA[<pre><code class="language-cli">#include &quot;stdafx.h&quot;

using namespace std;

template &lt;class T1&gt;
 int newton(T1 &amp;x, T1 (&amp;f)(T1), T1 (&amp;fdiv)(T1),
                  int max_loop, const double accuracy)
 {
    T1 term;
    do
        { 
         term = (f)(x) / (fdiv)(x);
         x = x - term;                                             
        }
    while ((abs(term / x) &gt; accuracy) &amp;&amp; (--max_loop));
    return max_loop;
 }
</code></pre>
<pre><code class="language-cli">double cfunc, cfdiv;
				 cfunc = Convert::ToDouble(func);
				 cfdiv = Convert::ToDouble(fdiv);

				 double x = -10.0;
				 if (newton(x, cfunc, cfdiv, 10000000000, 1.0e-8))
					 lbErgebnisNull-&gt;Text = Convert::ToString(x);
</code></pre>
<p>Fehler:</p>
<pre><code class="language-cli">error C2784: &quot;int newton(T1 &amp;,T1 (__clrcall &amp;)(T1),T1 (__clrcall &amp;)(T1),int,const double)&quot;: template-Argument für &quot;T1 (__clrcall &amp;)(T1)&quot; konnte nicht von &quot;double&quot; hergeleitet werden.
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/284204/template-argument-kann-nicht-hergeleitet-werden</link><generator>RSS for Node</generator><lastBuildDate>Sat, 22 Aug 2026 05:35:00 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/284204.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 27 Mar 2011 19:52:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Template Argument kann nicht hergeleitet werden on Sun, 27 Mar 2011 19:52:00 GMT]]></title><description><![CDATA[<pre><code class="language-cli">#include &quot;stdafx.h&quot;

using namespace std;

template &lt;class T1&gt;
 int newton(T1 &amp;x, T1 (&amp;f)(T1), T1 (&amp;fdiv)(T1),
                  int max_loop, const double accuracy)
 {
    T1 term;
    do
        { 
         term = (f)(x) / (fdiv)(x);
         x = x - term;                                             
        }
    while ((abs(term / x) &gt; accuracy) &amp;&amp; (--max_loop));
    return max_loop;
 }
</code></pre>
<pre><code class="language-cli">double cfunc, cfdiv;
				 cfunc = Convert::ToDouble(func);
				 cfdiv = Convert::ToDouble(fdiv);

				 double x = -10.0;
				 if (newton(x, cfunc, cfdiv, 10000000000, 1.0e-8))
					 lbErgebnisNull-&gt;Text = Convert::ToString(x);
</code></pre>
<p>Fehler:</p>
<pre><code class="language-cli">error C2784: &quot;int newton(T1 &amp;,T1 (__clrcall &amp;)(T1),T1 (__clrcall &amp;)(T1),int,const double)&quot;: template-Argument für &quot;T1 (__clrcall &amp;)(T1)&quot; konnte nicht von &quot;double&quot; hergeleitet werden.
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2041013</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2041013</guid><dc:creator><![CDATA[Stani2HD]]></dc:creator><pubDate>Sun, 27 Mar 2011 19:52:00 GMT</pubDate></item><item><title><![CDATA[Reply to Template Argument kann nicht hergeleitet werden on Sun, 27 Mar 2011 21:49:16 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">int newton(T1 &amp;x, T1 (&amp;f)(T1), T1 (&amp;fdiv)(T1), //&lt;-- Funktionszeiger?
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2041051</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2041051</guid><dc:creator><![CDATA[Gate]]></dc:creator><pubDate>Sun, 27 Mar 2011 21:49:16 GMT</pubDate></item><item><title><![CDATA[Reply to Template Argument kann nicht hergeleitet werden on Mon, 28 Mar 2011 06:55:09 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/u18363" rel="nofollow">Jochen Kalmbach</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/f58" rel="nofollow">C++/CLI mit .NET</a> in das Forum <a href="http://www.c-plusplus.net/forum/f15" rel="nofollow">C++ (auch C++0x)</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2041111</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2041111</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Mon, 28 Mar 2011 06:55:09 GMT</pubDate></item><item><title><![CDATA[Reply to Template Argument kann nicht hergeleitet werden on Mon, 28 Mar 2011 07:07:06 GMT]]></title><description><![CDATA[<p>Gate schrieb:</p>
<blockquote>
<pre><code class="language-cpp">int newton(T1 &amp;x, T1 (&amp;f)(T1), T1 (&amp;fdiv)(T1), //&lt;-- Funktionszeiger?
</code></pre>
</blockquote>
<p>--&gt;</p>
<pre><code class="language-cpp">namespace Convert
{

double ToDouble(double x)
{
    return x;
}

}

int main()
{
    double d = -10.0;
    int n = newton(d, Convert::ToDouble, Convert::ToDouble, 10000000, 1e-8);
    return 0;
}
</code></pre>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2041113</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2041113</guid><dc:creator><![CDATA[brotbernd]]></dc:creator><pubDate>Mon, 28 Mar 2011 07:07:06 GMT</pubDate></item><item><title><![CDATA[Reply to Template Argument kann nicht hergeleitet werden on Mon, 28 Mar 2011 08:13:18 GMT]]></title><description><![CDATA[<p>Vermutlich weil Convert::ToDouble zig mal überladen ist und der Compiler nicht wissen kann, dass Du die Methode mit dem Double-Parameter meinst.</p>
<p>EDIT: Darüberhinaus gibt es in C++ keine Referenzen auf Funktionen, höchstens [opt: Referenzen auf] Funktionszeiger. Also T1 (*fn)(T1) und &amp;Convert::ToDouble.</p>
<p>Du vermischt hier C++ und C++/CLI Code... Absicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2041138</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2041138</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Mon, 28 Mar 2011 08:13:18 GMT</pubDate></item></channel></rss>