Click here to Skip to main content
15,917,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: dialogbox with textbox Pin
Justin Tay4-Jul-06 6:46
Justin Tay4-Jul-06 6:46 
GeneralRe: dialogbox with textbox Pin
Desmo164-Jul-06 6:58
Desmo164-Jul-06 6:58 
GeneralRe: dialogbox with textbox Pin
Justin Tay4-Jul-06 7:32
Justin Tay4-Jul-06 7:32 
GeneralRe: dialogbox with textbox Pin
Desmo164-Jul-06 22:25
Desmo164-Jul-06 22:25 
GeneralRe: dialogbox with textbox Pin
Desmo164-Jul-06 22:35
Desmo164-Jul-06 22:35 
GeneralRe: dialogbox with textbox Pin
Justin Tay5-Jul-06 1:21
Justin Tay5-Jul-06 1:21 
GeneralRe: dialogbox with textbox Pin
Desmo165-Jul-06 5:29
Desmo165-Jul-06 5:29 
Questiontemplate metaprogramming question Pin
FocusedWolf4-Jul-06 6:14
FocusedWolf4-Jul-06 6:14 
I was reading about this compile-time computation stuff and quickly found a limitation where according to c++ standard, and vs2005 restrictions Hmmm | :| , that you can only pass an int as a parameter... so all these metaprograms would be taking in either typename's or ints in the <>'s and returning ints as with enum

<br />
template<int N> <br />
struct Pow3 <br />
{ <br />
	enum { result=3*Pow3<N-1>::result }; <br />
}; <br />
<br />
template<> <br />
struct Pow3<0> <br />
{ <br />
	enum { result = 1 }; <br />
}; <br />


or static const int

<br />
template<int N> <br />
struct Pow2 <br />
{ <br />
    static const int result = 3*Pow3<N-1>::result; <br />
}; <br />
<br />
template<> <br />
struct Pow2<0> <br />
{ <br />
	static const int result = 1;<br />
}; <br />



My question is i've seen code that used a function to accept parameters of other types...would these be compile-time initialized/optimized to?

<br />
template <int value, typename returnType><br />
struct DividePi<br />
{<br />
	static returnType Result(float SomeFloat)<br />
	{<br />
		return Pi / value;<br />
	}<br />
};<br />
<br />
template <typename returnType><br />
struct DividePi <0, returnType><br />
{<br />
	static returnType Result(float SomeFloat)<br />
	{<br />
		return 0;<br />
	}<br />
};<br />

AnswerRe: template metaprogramming question Pin
Sarath C4-Jul-06 6:47
Sarath C4-Jul-06 6:47 
QuestionDraw on a control Pin
Daniel Kanev4-Jul-06 5:48
Daniel Kanev4-Jul-06 5:48 
QuestionRe: Draw on a control Pin
Sarath C4-Jul-06 5:52
Sarath C4-Jul-06 5:52 
AnswerRe: Draw on a control Pin
Hamid_RT4-Jul-06 6:03
Hamid_RT4-Jul-06 6:03 
GeneralRe: Draw on a control Pin
Daniel Kanev4-Jul-06 8:10
Daniel Kanev4-Jul-06 8:10 
GeneralRe: Draw on a control Pin
Hamid_RT4-Jul-06 19:14
Hamid_RT4-Jul-06 19:14 
QuestionUsing STL with SmartHeap Pin
Jack Hui4-Jul-06 5:01
Jack Hui4-Jul-06 5:01 
QuestionHow can i make resident program in visual c++? Pin
Knightman4-Jul-06 4:12
Knightman4-Jul-06 4:12 
AnswerRe: How can i make resident program in visual c++? Pin
Sarath C4-Jul-06 4:38
Sarath C4-Jul-06 4:38 
AnswerRe: How can i make resident program in visual c++? Pin
Gary R. Wheeler4-Jul-06 5:57
Gary R. Wheeler4-Jul-06 5:57 
Questiondialog handle [modified] Pin
locoone4-Jul-06 4:07
locoone4-Jul-06 4:07 
AnswerRe: dialog handle Pin
Justin Tay4-Jul-06 5:34
Justin Tay4-Jul-06 5:34 
AnswerRe: dialog handle Pin
Kharfax4-Jul-06 6:12
Kharfax4-Jul-06 6:12 
Questionhow can i mix this 2 project ! Pin
farshad.f4-Jul-06 4:02
farshad.f4-Jul-06 4:02 
AnswerRe: how can i mix this 2 project ! Pin
Sarath C4-Jul-06 5:55
Sarath C4-Jul-06 5:55 
GeneralRe: how can i mix this 2 project ! [modified] Pin
farshad.f4-Jul-06 6:48
farshad.f4-Jul-06 6:48 
QuestionCFileDialog Pin
Desmo164-Jul-06 4:01
Desmo164-Jul-06 4:01 

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.