Click here to Skip to main content
15,921,989 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: List assertation failure Pin
Graham Breach2-Oct-22 21:46
Graham Breach2-Oct-22 21:46 
GeneralRe: List assertation failure Pin
ForNow3-Oct-22 8:49
ForNow3-Oct-22 8:49 
AnswerRe: List assertation failure Pin
CPallini2-Oct-22 21:08
mveCPallini2-Oct-22 21:08 
GeneralRe: List assertation failure Pin
ForNow2-Oct-22 22:17
ForNow2-Oct-22 22:17 
QuestionMessage Closed Pin
2-Oct-22 9:45
Member 149687712-Oct-22 9:45 
AnswerRe: Connect to terminal native window - repost Pin
Dave Kreskowiak2-Oct-22 16:49
mveDave Kreskowiak2-Oct-22 16:49 
AnswerRe: Connect to terminal native window - repost Pin
Richard MacCutchan2-Oct-22 22:34
mveRichard MacCutchan2-Oct-22 22:34 
GeneralMessage Closed Pin
3-Oct-22 7:50
Member 149687713-Oct-22 7:50 
GeneralRe: Connect to terminal native window - repost Pin
Richard MacCutchan3-Oct-22 9:15
mveRichard MacCutchan3-Oct-22 9:15 
GeneralMessage Closed Pin
3-Oct-22 11:13
Member 149687713-Oct-22 11:13 
GeneralRe: Connect to terminal native window - repost Pin
k50543-Oct-22 11:58
mvek50543-Oct-22 11:58 
GeneralRe: Connect to terminal native window - repost Pin
Richard MacCutchan3-Oct-22 21:54
mveRichard MacCutchan3-Oct-22 21:54 
QuestionRe: Connect to terminal native window - repost Pin
David Crow4-Oct-22 5:17
David Crow4-Oct-22 5:17 
AnswerMessage Closed Pin
4-Oct-22 7:03
Member 149687714-Oct-22 7:03 
GeneralMessage Closed Pin
4-Oct-22 19:10
Member 149687714-Oct-22 19:10 
GeneralRe: Connect to terminal native window - repost Pin
k50545-Oct-22 4:32
mvek50545-Oct-22 4:32 
GeneralMessage Closed Pin
5-Oct-22 9:37
Member 149687715-Oct-22 9:37 
GeneralRe: Connect to terminal native window - repost Pin
Richard MacCutchan5-Oct-22 22:47
mveRichard MacCutchan5-Oct-22 22:47 
GeneralMessage Closed Pin
6-Oct-22 4:42
Member 149687716-Oct-22 4:42 
GeneralRe: Connect to terminal native window - repost Pin
Richard MacCutchan6-Oct-22 4:56
mveRichard MacCutchan6-Oct-22 4:56 
GeneralMessage Closed Pin
7-Oct-22 8:57
Member 149687717-Oct-22 8:57 
GeneralRe: Connect to terminal native window - repost Pin
Richard MacCutchan7-Oct-22 9:25
mveRichard MacCutchan7-Oct-22 9:25 
Questionx86 Assembly Language Pin
Member 1578377429-Sep-22 23:51
Member 1578377429-Sep-22 23:51 
AnswerRe: x86 Assembly Language Pin
Richard Deeming30-Sep-22 0:14
mveRichard Deeming30-Sep-22 0:14 
Questiontype trait is_base_of compiles here but not there Pin
BernardIE531728-Sep-22 2:33
BernardIE531728-Sep-22 2:33 
Greetings Kind Regards Each of the two uses of the type trait is_base_of compiles differently. One w/ error the other w/o. Any idea why the difference? It is documented as requiring a completed type I am not certain as to its meaning but the question remains why the difference? Thank You Kindly

The precise error message wrt the requires expression is:

1>D:\a\_work\1\s\binaries\x86ret\inc\type_traits(1152,28): error C2139: 'cDERIVED': an undefined class is not allowed as an argument to compiler intrinsic type trait '__is_base_of'
hello_world.cpp(5): message : see declaration of 'cDERIVED'
hello_world.cpp(7): message : see reference to variable template 'const bool is_base_of_v<cbase,cderived>' being compiled
hello_world.cpp(9,2): error C7602: 'cDERIVED::someClass': the associated constraints are not satisfied
hello_world.cpp(8): message : see declaration of 'cDERIVED::someClass'
hello_world.cpp(7,32): message : the constraint was not satisfied
hello_world.cpp(9,22): error C2955: 'cDERIVED::someClass': use of class template requires template argument list
hello_world.cpp(8): message : see declaration of 'cDERIVED::someClass'
1>Done building project "hello_world.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Elapsed 00:02.511 ==========


C++
import std.core;
using namespace std;

class cBASE {};
struct cDERIVED : public cBASE
{
	template<typename T> requires is_base_of_v<cBASE, cDERIVED> // will not compile
	class someClass {};
	someClass<cDERIVED> someData;
	constexpr bool TEST_is_base_of() { return is_base_of_v<cBASE, cDERIVED>; } // will compile and return true
};

int main()
{
	cout << "Hello World\n";
	cout << boolalpha;

	cDERIVED _derived;
	cout << _derived.TEST_is_base_of();
}


modified 28-Sep-22 14:14pm.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.