Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

c++ - Multiple-File Template Implementation -


with normal functions, declaration , definition separated across multiple files so:

// foo.h  namespace foo {     void bar(); } 

.

// foo.cpp  #include "foo.h"  void foo::bar() {     cout << "inside function." << endl; } 

it understanding cannot done templates. declaration , definition must not separate because appropriate form of template created "on-demand" when needed.

so, how , templates typically defined in multiple-file project this? intuition in foo.cpp because that's "meat" of functions is, on other hand it's header file that's going included.

template code stays in .hh file. there's no reason make them separate files, though practice put definitions after all declarations.

when compiler generates template code, flags linker knows instantiation of template in 1 compilation unit (i.e. .o file) exact same code 1 in unit. keep 1 , discard rest, rather bailing out "multiply defined symbol" error.

this true of modern compilers template support. in case of gcc, since 2.8. (i know, wrote lot of code gcc 2.7.2.2 before smartened linker , had jump through hoops make templates build right.)


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -