<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html xmlns:gcse="googleCustomSearch"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="shortcut icon" href="dlib-icon.ico"><meta name="verify-v1" content="02MiiaFNVzS5/u0eQhsy3/knioFHsia1X3DXRpHkE6I="><meta name="google-site-verification" content="DGSSJMKDomaDaDTIRJ8jDkv0YMx9Cz7OESbXHjjr6Jw"><title>dlib C++ Library
               - Metaprogramming</title><script type="text/javascript" src="dlib.js"></script><link rel="stylesheet" type="text/css" href="dlib.css"></head><body><a name="top"></a><div id="page_header"><a href="http://dlib.net"><img src="dlib-logo.png"></a></div><div id="top_content"><div id="main_menu" class="menu"><div class="menu_top"><b>The Library</b><ul class="tree"><li><a href="algorithms.html" class="menu">Algorithms</a></li><li><a href="api.html" class="menu">API Wrappers</a></li><li><a href="bayes.html" class="menu">Bayesian Nets</a></li><li><a href="compression.html" class="menu">Compression</a></li><li><a href="containers.html" class="menu">Containers</a></li><li><a href="graph_tools.html" class="menu">Graph Tools</a></li><li><a href="imaging.html" class="menu">Image Processing</a></li><li><a href="linear_algebra.html" class="menu">Linear Algebra</a></li><li><a href="ml.html" class="menu">Machine Learning</a></li><li><a href="metaprogramming.html" class="menu">Metaprogramming</a></li><li><a href="other.html" class="menu">Miscellaneous</a></li><li><a href="network.html" class="menu">Networking</a></li><li><a href="optimization.html" class="menu">Optimization</a></li><li><a href="parsing.html" class="menu">Parsing</a></li></ul><br><b>Help/Info</b><ul class="tree"><li><a href="http://blog.dlib.net" class="menu">Dlib Blog</a></li><li><a onclick="Toggle(this)" class="sub menu"><img src="plus.gif">Examples: C++</a><ul style="display:none;"><li><a href="3d_point_cloud_ex.cpp.html" class="menu">3D Point Cloud</a></li><li><a href="assignment_learning_ex.cpp.html" class="menu">Assignment Learning</a></li><li><a href="file_to_code_ex.cpp.html" class="menu">Base64 Encoder</a></li><li><a href="bayes_net_from_disk_ex.cpp.html" class="menu">Bayesian Network From Disk</a></li><li><a href="bayes_net_gui_ex.cpp.html" class="menu">Bayesian Network GUI</a></li><li><a href="bayes_net_ex.cpp.html" class="menu">Bayesian Network</a></li><li><a href="bridge_ex.cpp.html" class="menu">Bridge</a></li><li><a href="bsp_ex.cpp.html" class="menu">BSP</a></li><li><a href="svm_c_ex.cpp.html" class="menu">C-Support Vector Machine</a></li><li><a href="compress_stream_ex.cpp.html#_top" class="menu">Cmd Line Parser</a></li><li><a href="compress_stream_ex.cpp.html" class="menu">Compress Stream</a></li><li><a href="config_reader_ex.cpp.html" class="menu">Config File Reader</a></li><li><a href="custom_trainer_ex.cpp.html" class="menu">Custom Trainers</a></li><li><a href="dnn_face_recognition_ex.cpp.html" class="menu">Deep Face Recognition</a></li><li><a href="dnn_mmod_dog_hipsterizer.cpp.html" class="menu">Deep Learning Dog Hipsterizer</a></li><li><a href="dnn_mmod_face_detection_ex.cpp.html" class="menu">Deep Learning Face Detection</a></li><li><a href="dnn_imagenet_ex.cpp.html" class="menu">Deep Learning Imagenet Classifier</a></li><li><a href="dnn_imagenet_train_ex.cpp.html" class="menu">Deep Learning Imagenet Trainer </a></li><li><a href="dnn_inception_ex.cpp.html" class="menu">Deep Learning Inception</a></li><li><a href="dnn_introduction_ex.cpp.html" class="menu">Deep Learning Introduction Part 1</a></li><li><a href="dnn_introduction2_ex.cpp.html" class="menu">Deep Learning Introduction Part 2</a></li><li><a href="dnn_mmod_ex.cpp.html" class="menu">Deep Learning Max-Margin Object Detection</a></li><li><a href="dnn_metric_learning_ex.cpp.html" class="menu">Deep Metric Learning Introduction</a></li><li><a href="dnn_metric_learning_on_images_ex.cpp.html" class="menu">Deep Metric Learning on Images</a></li><li><a href="dir_nav_ex.cpp.html" class="menu">Directory Navigation</a></li><li><a href="empirical_kernel_map_ex.cpp.html" class="menu">Empirical Kernel Map</a></li><li><a href="face_detection_ex.cpp.html" class="menu">Face Detection</a></li><li><a href="face_landmark_detection_ex.cpp.html" class="menu">Face Landmark Detection</a></li><li><a href="fhog_ex.cpp.html" class="menu">FHOG Feature Extraction</a></li><li><a href="fhog_object_detector_ex.cpp.html" class="menu">FHOG Object Detection</a></li><li><a href="graph_labeling_ex.cpp.html" class="menu">Graph Labeling</a></li><li><a href="gui_api_ex.cpp.html" class="menu">GUI</a></li><li><a href="hough_transform_ex.cpp.html" class="menu">Hough Transform</a></li><li><a href="server_http_ex.cpp.html" class="menu">HTTP Server</a></li><li><a href="image_ex.cpp.html" class="menu">Image</a></li><li><a href="iosockstream_ex.cpp.html" class="menu">IO Socket Streams</a></li><li><a href="server_iostream_ex.cpp.html" class="menu">IO Streams Server</a></li><li><a href="kcentroid_ex.cpp.html" class="menu">Kernel Centroid</a></li><li><a href="kkmeans_ex.cpp.html" class="menu">Kernel K-Means Clustering</a></li><li><a href="krr_regression_ex.cpp.html" class="menu">Kernel Ridge Regression</a></li><li><a href="krls_filter_ex.cpp.html" class="menu">Kernel RLS Filtering</a></li><li><a href="krls_ex.cpp.html" class="menu">Kernel RLS Regression</a></li><li><a href="krr_classification_ex.cpp.html" class="menu">KRR Classification</a></li><li><a href="learning_to_track_ex.cpp.html" class="menu">Learning to Track</a></li><li><a href="max_cost_assignment_ex.cpp.html" class="menu">Linear Assignment Problems</a></li><li><a href="linear_manifold_regularizer_ex.cpp.html" class="menu">Linear Manifold Regularizer</a></li><li><a href="mpc_ex.cpp.html" class="menu">Linear Model Predictive Control</a></li><li><a href="logger_ex_2.cpp.html" class="menu">Logger Advanced</a></li><li><a href="logger_custom_output_ex.cpp.html" class="menu">Logger Custom Output</a></li><li><a href="logger_ex.cpp.html" class="menu">Logger</a></li><li><a href="matrix_expressions_ex.cpp.html" class="menu">Matrix Expressions</a></li><li><a href="matrix_ex.cpp.html" class="menu">Matrix</a></li><li><a href="member_function_pointer_ex.cpp.html" class="menu">Member Function Pointer</a></li><li><a href="model_selection_ex.cpp.html" class="menu">Model Selection</a></li><li><a href="multiclass_classification_ex.cpp.html" class="menu">Multiclass Classification</a></li><li><a href="multithreaded_object_ex.cpp.html" class="menu">Multithreaded Object</a></li><li><a href="mlp_ex.cpp.html" class="menu">Neural Network</a></li><li><a href="least_squares_ex.cpp.html" class="menu">Non-Linear Least Squares</a></li><li><a href="svm_ex.cpp.html" class="menu">Nu-Support Vector Machine</a></li><li><a href="integrate_function_adapt_simp_ex.cpp.html" class="menu">Numerical Integration</a></li><li><a href="object_detector_advanced_ex.cpp.html" class="menu">Object Detector Advanced</a></li><li><a href="object_detector_ex.cpp.html" class="menu">Object Detector</a></li><li><a href="one_class_classifiers_ex.cpp.html" class="menu">One Class Classifiers</a></li><li><a href="svm_pegasos_ex.cpp.html" class="menu">Online SVM</a></li><li><a href="optimization_ex.cpp.html" class="menu">Optimization</a></li><li><a href="parallel_for_ex.cpp.html" class="menu">Parallel For Loops</a></li><li><a href="pipe_ex_2.cpp.html" class="menu">Pipe 2</a></li><li><a href="pipe_ex.cpp.html" class="menu">Pipe</a></li><li><a href="quantum_computing_ex.cpp.html" class="menu">Quantum Computing</a></li><li><a href="queue_ex.cpp.html" class="menu">Queue</a></li><li><a href="random_cropper_ex.cpp.html" class="menu">Random Cropper</a></li><li><a href="rank_features_ex.cpp.html" class="menu">Rank Features</a></li><li><a href="rvm_ex.cpp.html" class="menu">Relevance Vector Classification</a></li><li><a href="rvm_regression_ex.cpp.html" class="menu">Relevance Vector Regression</a></li><li><a href="running_stats_ex.cpp.html" class="menu">Running Stats</a></li><li><a href="sequence_labeler_ex.cpp.html" class="menu">Sequence Labeling</a></li><li><a href="sequence_segmenter_ex.cpp.html" class="menu">Sequence Segmentation</a></li><li><a href="sockets_ex.cpp.html" class="menu">Sockets</a></li><li><a href="sockstreambuf_ex.cpp.html" class="menu">Sockstreambuf</a></li><li><a href="svm_sparse_ex.cpp.html" class="menu">Sparse Vectors</a></li><li><a href="sqlite_ex.cpp.html" class="menu">SQLite</a></li><li><a href="std_allocator_ex.cpp.html" class="menu">Std C++ Allocator</a></li><li><a href="svm_struct_ex.cpp.html" class="menu">Structural Support Vector Machines</a></li><li><a href="svr_ex.cpp.html" class="menu">Support Vector Regression</a></li><li><a href="surf_ex.cpp.html" class="menu">SURF</a></li><li><a href="svm_rank_ex.cpp.html" class="menu">SVM-Rank</a></li><li><a href="thread_function_ex.cpp.html" class="menu">Thread Function</a></li><li><a href="thread_pool_ex.cpp.html" class="menu">Thread Pool</a></li><li><a href="threaded_object_ex.cpp.html" class="menu">Threaded Object</a></li><li><a href="threads_ex.cpp.html" class="menu">Threads</a></li><li><a href="timer_ex.cpp.html" class="menu">Timer</a></li><li><a href="train_object_detector.cpp.html" class="menu">Train Object Detector</a></li><li><a href="train_shape_predictor_ex.cpp.html" class="menu">Train Shape Predictor</a></li><li><a href="using_custom_kernels_ex.cpp.html" class="menu">Using Custom Kernels</a></li><li><a href="video_tracking_ex.cpp.html" class="menu">Video Object Tracking</a></li><li><a href="webcam_face_pose_ex.cpp.html" class="menu">Webcam Face Pose Estimation</a></li><li><a href="xml_parser_ex.cpp.html" class="menu">XML Parser</a></li></ul></li><li><a onclick="Toggle(this)" class="sub menu"><img src="plus.gif">Examples: Python</a><ul style="display:none;"><li><a href="face_detector.py.html" class="menu">Face Detector</a></li><li><a href="face_landmark_detection.py.html" class="menu">Face Landmark Detection</a></li><li><a href="face_recognition.py.html" class="menu">Face Recognition</a></li><li><a href="find_candidate_object_locations.py.html" class="menu">Find Candidate Object Locations</a></li><li><a href="max_cost_assignment.py.html" class="menu">Linear Assignment Problems</a></li><li><a href="sequence_segmenter.py.html" class="menu">Sequence Segmenter</a></li><li><a href="svm_struct.py.html" class="menu">Structural Support Vector Machines</a></li><li><a href="svm_rank.py.html" class="menu">SVM-Rank</a></li><li><a href="train_object_detector.py.html" class="menu">Train Object Detector</a></li><li><a href="train_shape_predictor.py.html" class="menu">Train Shape Predictor</a></li><li><a href="correlation_tracker.py.html" class="menu">Video Object Tracking</a></li></ul></li><li><a href="faq.html" class="menu">FAQ</a></li><li><a href="index.html" class="menu">Home</a></li><li><a href="compile.html" class="menu">How to compile</a></li><li><a href="howto_contribute.html" class="menu">How to contribute</a></li><li><a href="term_index.html" class="menu">Index</a></li><li><a href="intro.html" class="menu">Introduction</a></li><li><a href="license.html" class="menu">License</a></li><li><a href="python/index.html" class="menu">Python API</a></li><li><a href="books.html" class="menu">Suggested Books</a></li><li><a href="http://sourceforge.net/p/dclib/wiki/Known_users/" class="menu">Who uses dlib?</a></li></ul><br><b>Current Release</b><ul class="tree"><li><a href="change_log.html" class="menu">Change Log</a></li><li><a href="release_notes.html" class="menu">Release Notes</a></li><li>Version: 19.4</li></ul><br></div><div class="menu_footer">
      Last Modified:<br>Aug 28, 2016</div></div><div id="main_text"><div id="main_text_title">Metaprogramming</div><div id="main_text_body"><p>
         This page documents library components that provide metaprogramming sorts of functionality.  For
         the most part they are useful for putting design by contract checks into code or doing various kinds of
         clever things with templates. 
         </p><p>
            For example, you might have a templated function that is templated on a type T and you want to
            make sure that T is either a char or wchar_t type.  You could place the following into your code
            and it would cause the compile to error out when T was set to something other than char or wchar_t.
            <br><tt>COMPILE_TIME_ASSERT((is_same_type&lt;T,char&gt;::value || is_same_type&lt;T,wchar_t&gt;::value));</tt></p></div></div><div id="right_menu" class="menu"><div class="menu_top"><b>Objects</b><ul class="tree"><li><a href="#basic_type" class="menu">basic_type</a></li><li><a href="#enable_if" class="menu">enable_if</a></li><li><a href="#is_array" class="menu">is_array</a></li><li><a href="#is_array2d" class="menu">is_array2d</a></li><li><a href="#is_built_in_scalar_type" class="menu">is_built_in_scalar_type</a></li><li><a href="#is_complex" class="menu">is_complex</a></li><li><a href="#is_config_reader" class="menu">is_config_reader</a></li><li><a href="#is_const_type" class="menu">is_const_type</a></li><li><a href="#is_convertible" class="menu">is_convertible</a></li><li><a href="#is_directed_graph" class="menu">is_directed_graph</a></li><li><a href="#is_float_type" class="menu">is_float_type</a></li><li><a href="#is_function" class="menu">is_function</a></li><li><a href="#is_graph" class="menu">is_graph</a></li><li><a href="#is_matrix" class="menu">is_matrix</a></li><li><a href="#is_pair" class="menu">is_pair</a></li><li><a href="#is_pointer_type" class="menu">is_pointer_type</a></li><li><a href="#is_rand" class="menu">is_rand</a></li><li><a href="#is_reference_type" class="menu">is_reference_type</a></li><li><a href="#is_same_type" class="menu">is_same_type</a></li><li><a href="#is_signed_type" class="menu">is_signed_type</a></li><li><a href="#is_std_vector" class="menu">is_std_vector</a></li><li><a href="#is_unsigned_type" class="menu">is_unsigned_type</a></li><li><a href="#noncopyable" class="menu">noncopyable</a></li><li><a href="#promote" class="menu">promote</a></li><li><a href="#static_switch" class="menu">static_switch</a></li><li><a href="#tabs" class="menu">tabs</a></li><li><a href="#tmax" class="menu">tmax</a></li><li><a href="#tmin" class="menu">tmin</a></li><li><a href="#unsigned_type" class="menu">unsigned_type</a></li></ul><br><b>Global Functions</b><ul class="tree"><li><a href="#ASSERT_ARE_NOT_SAME_TYPE" class="menu">ASSERT_ARE_NOT_SAME_TYPE</a></li><li><a href="#ASSERT_ARE_SAME_TYPE" class="menu">ASSERT_ARE_SAME_TYPE</a></li><li><a href="#assign_zero_if_built_in_scalar_type" class="menu">assign_zero_if_built_in_scalar_type</a></li><li><a href="#COMPILE_TIME_ASSERT" class="menu">COMPILE_TIME_ASSERT</a></li><li><a href="#DLIB_ASSERT" class="menu">DLIB_ASSERT</a></li><li><a href="#DLIB_ASSERT_HAS_STANDARD_LAYOUT" class="menu">DLIB_ASSERT_HAS_STANDARD_LAYOUT</a></li><li><a href="#DLIB_CASSERT" class="menu">DLIB_CASSERT</a></li><li><a href="#DLIB_MAKE_HAS_MEMBER_FUNCTION_TEST" class="menu">DLIB_MAKE_HAS_MEMBER_FUNCTION_TEST</a></li><li><a href="#DLIB_STACK_TRACE" class="menu">DLIB_STACK_TRACE</a></li><li><a href="#DLIB_STACK_TRACE_NAMED" class="menu">DLIB_STACK_TRACE_NAMED</a></li><li><a href="#get_stack_trace" class="menu">get_stack_trace</a></li><li><a href="#is_same_object" class="menu">is_same_object</a></li><li><a href="#wrap_function" class="menu">wrap_function</a></li><li><a href="#_dT" class="menu">_dT</a></li></ul><br><b>Other</b><ul class="tree"><li><a href="#portability_macros" class="menu">portability_macros</a></li></ul><br></div><div class="menu_footer"></div></div></div><div id="bottom_content"><a name="ASSERT_ARE_NOT_SAME_TYPE"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">ASSERT_ARE_NOT_SAME_TYPE</h1><BR><BR><p>
            This is a macro function for debugging.  Its form is <tt>ASSERT_ARE_NOT_SAME_TYPE(type1, type2)</tt>.  
            If type1 and type2 are the same type then the compile will fail.  This is sometimes useful 
            in validating template arguments.
      </p><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/assert.h.html">More Details...</a><div class="include_file">#include &lt;dlib/assert.h&gt;</div></div></div><a name="ASSERT_ARE_SAME_TYPE"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">ASSERT_ARE_SAME_TYPE</h1><BR><BR><p>
            This is a macro function for debugging.  Its form is <tt>ASSERT_ARE_SAME_TYPE(type1, type2)</tt>.  
            If type1 and type2 are not the same type then the compile will fail.  This is sometimes useful 
            in validating template arguments.
      </p><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/assert.h.html">More Details...</a><div class="include_file">#include &lt;dlib/assert.h&gt;</div></div></div><a name="assign_zero_if_built_in_scalar_type"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">assign_zero_if_built_in_scalar_type</h1><BR><BR><p>
               This function assigns its argument the value of 0 if it is a built in scalar
               type according to the <a href="#is_built_in_scalar_type">is_built_in_scalar_type</a>
               template.  If it isn't a built in scalar type then it does nothing.
            </p><p>
               This function is useful for suppressing compiler warnings about uninitialized 
               types inside of templates that are designed to accept the built in types
               as well as user defined classes.
            </p><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#assign_zero_if_built_in_scalar_type">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="basic_type"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">basic_type</h1><BR><BR>
        This is a template that takes a type and strips off any const, volatile, or reference
        qualifiers and gives you back the basic underlying type.  

         <p>
        For example, promote&lt;const int&amp;&gt;::type == int 
         </p><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#basic_type">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="COMPILE_TIME_ASSERT"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">COMPILE_TIME_ASSERT</h1><BR><BR><p>
            This is a macro function for debugging.  Its form is <tt>COMPILE_TIME_ASSERT(condition that should 
            be true)</tt>.  The condition must be a compile time constant and if it is false then the compile
            will fail.
      </p><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/assert.h.html">More Details...</a><div class="include_file">#include &lt;dlib/assert.h&gt;</div></div></div><a name="DLIB_ASSERT"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">DLIB_ASSERT</h1><BR><BR><p>
            This is a macro function for debugging.  Its form is 
<pre class="code_box">DLIB_ASSERT(condition that should be true, error message)</pre> 
or you can omit the error message and call it like:
<pre class="code_box">DLIB_ASSERT(condition that should be true)</pre>
            If the condition is false DLIB_ASSERT throws an exception of type 
            dlib::fatal_error with fatal_error::type == EBROKEN_ASSERT.  An error message detailing
            the nature of the problem is stored in the member variable info which is of type std::string.  
            Look in the following file for more details.  The exception classes are defined 
            <a href="dlib/error.h.html#error">here</a>.
      </p><p>
         This macro is only enabled if _DEBUG, DEBUG or ENABLE_ASSERTS is defined.  Also, if this macro <i>is</i>
         enabled then ENABLE_ASSERTS will be defined even if you didn't define it.
      </p><p>
         Note that when this macro fails and throws an exception it also calls the global
         C function dlib_assert_breakpoint().  This behavior makes it easy to set a debugging
         tool to break when DLIB_ASSERT fails by setting a breakpoint on dlib_assert_breakpoint().
      </p><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/assert.h.html">More Details...</a><div class="include_file">#include &lt;dlib/assert.h&gt;</div></div></div><a name="DLIB_ASSERT_HAS_STANDARD_LAYOUT"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">DLIB_ASSERT_HAS_STANDARD_LAYOUT</h1><BR><BR><p>
        This macro is meant to cause a compiler error if a type doesn't have a simple
        memory layout (like a C struct). In particular, types with simple layouts are
        ones which can be copied via memcpy().
      </p>
        
        This was called a POD type in C++03 and in C++0x we are looking to check if 
        it is a "standard layout type".  Once we can use C++0x we can change this macro 
        to something that uses the std::is_standard_layout type_traits class.  
        See: http://www2.research.att.com/~bs/C++0xFAQ.html#PODs
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/assert.h.html#DLIB_ASSERT_HAS_STANDARD_LAYOUT">More Details...</a><div class="include_file">#include &lt;dlib/assert.h&gt;</div></div></div><a name="DLIB_CASSERT"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">DLIB_CASSERT</h1><BR><BR><p>
         This is a macro function that is identical to the <a href="#DLIB_ASSERT">DLIB_ASSERT</a> macro
         except that it is always enabled.  Even if _DEBUG, DEBUG and ENABLE_ASSERTS are not defined.
      </p><p>
         Note that when this macro fails and throws an exception it also calls the global
         C function dlib_assert_breakpoint().  This behavior makes it easy to set a debugging
         tool to break when DLIB_CASSERT fails by setting a breakpoint on dlib_assert_breakpoint().
      </p><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/assert.h.html">More Details...</a><div class="include_file">#include &lt;dlib/assert.h&gt;</div></div></div><a name="DLIB_MAKE_HAS_MEMBER_FUNCTION_TEST"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">DLIB_MAKE_HAS_MEMBER_FUNCTION_TEST</h1><BR><BR><p>
            The DLIB_MAKE_HAS_MEMBER_FUNCTION_TEST() macro is used to define traits templates
            that tell you if a class has a certain member function.  For example, to make a
            test to see if a class has a public method with the signature void print(int) you
            would say:
            </p><blockquote><tt>DLIB_MAKE_HAS_MEMBER_FUNCTION_TEST(has_print, void, print, (int))</tt></blockquote>
            Then you can check if a class, T, has this method by looking at the boolean value:
            <blockquote><tt>has_print&lt;T&gt;::value</tt></blockquote>
            which will be true if the member function is in the T class.

         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#DLIB_MAKE_HAS_MEMBER_FUNCTION_TEST">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="DLIB_STACK_TRACE"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">DLIB_STACK_TRACE</h1><BR><BR><p>
            This is a preprocessor macro that allows you to tag a function so 
            that dlib will keep track of it in a function call stack.  That is,
            you will be able to see a stack trace by calling <a href="#get_stack_trace">get_stack_trace</a>
            if you put this macro at the top of your functions.
         </p><p>
            This macro is only enabled if DLIB_ENABLE_STACK_TRACE is defined.  If it isn't defined then
            this macro doesn't do anything.  Also note that when this macro is defined it will
            cause <a href="#DLIB_ASSERT">DLIB_ASSERT</a> and <a href="#DLIB_CASSERT">DLIB_CASSERT</a>
            to include a stack trace in their error messages.
         </p><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/stack_trace.h.html">More Details...</a><div class="include_file">#include &lt;dlib/assert.h&gt;</div></div></div><a name="DLIB_STACK_TRACE_NAMED"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">DLIB_STACK_TRACE_NAMED</h1><BR><BR>
            This is a preprocessor macro just like <a href="#DLIB_STACK_TRACE">DLIB_STACK_TRACE</a>
            except that it allows you to supply your own string to use as the function name
            in the stack trace instead of the one deduced by DLIB_STACK_TRACE.
            <p>
               This macro is only enabled if DLIB_ENABLE_STACK_TRACE is defined.  
            </p><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/stack_trace.h.html">More Details...</a><div class="include_file">#include &lt;dlib/assert.h&gt;</div></div></div><a name="enable_if"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">enable_if</h1><BR><BR>
            This is a family of templates from the Boost C++ libraries that makes it somewhat easier to control
            template specialization.  For the details see <a href="enable_if.html">
               this page</a>.  Note that the header <tt>dlib/enable_if.h</tt> brings
               these templates into the dlib namespace.<br><BR><div class="include_file_more_details_wrapper"><div class="include_file">#include &lt;dlib/enable_if.h&gt;</div></div></div><a name="get_stack_trace"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">get_stack_trace</h1><BR><BR>
            This function allows you to query the current stack trace.
            <p>
               This macro is only enabled if DLIB_ENABLE_STACK_TRACE is defined.  
            </p><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/stack_trace.h.html">More Details...</a><div class="include_file">#include &lt;dlib/assert.h&gt;</div></div></div><a name="is_array"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_array</h1><BR><BR>
            This is a template where is_array&lt;T&gt;::value == true when T
            is an <a href="containers.html#array">array</a> object.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/is_kind.h.html#is_array">More Details...</a><div class="include_file">#include &lt;dlib/is_kind.h&gt;</div></div></div><a name="is_array2d"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_array2d</h1><BR><BR>
            This is a template where is_array2d&lt;T&gt;::value == true when T
            is an <a href="containers.html#array2d">array2d</a> object.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/is_kind.h.html#is_array2d">More Details...</a><div class="include_file">#include &lt;dlib/is_kind.h&gt;</div></div></div><a name="is_built_in_scalar_type"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_built_in_scalar_type</h1><BR><BR>
            This is a template where is_built_in_scalar_type&lt;T&gt;::value == true when T
            is a built in scalar type such as int, char, float, etc.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#is_built_in_scalar_type">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="is_complex"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_complex</h1><BR><BR>
            This is a template that can be used to determine if a type is a
            specialization of std::complex.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/matrix/matrix_utilities.h.html#is_complex">More Details...</a><div class="include_file">#include &lt;dlib/matrix.h&gt;</div></div></div><a name="is_config_reader"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_config_reader</h1><BR><BR>
            This is a template where is_config_reader&lt;T&gt;::value == true when T
            is a <a href="parsing.html#config_reader">config_reader</a> or
            config_reader_thread_safe object.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/is_kind.h.html#is_config_reader">More Details...</a><div class="include_file">#include &lt;dlib/is_kind.h&gt;</div></div></div><a name="is_const_type"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_const_type</h1><BR><BR>
            This is a template where is_const_type&lt;T&gt;::value == true when T is a const 
            type and false otherwise.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#is_const_type">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="is_convertible"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_convertible</h1><BR><BR>
            This is a template that can be used to determine if one type is convertible 
            into another type.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#is_convertible">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="is_directed_graph"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_directed_graph</h1><BR><BR>
            This is a template where is_directed_graph&lt;T&gt;::value == true when T
            is a <a href="containers.html#directed_graph">directed_graph</a> object.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/is_kind.h.html#is_directed_graph">More Details...</a><div class="include_file">#include &lt;dlib/is_kind.h&gt;</div></div></div><a name="is_float_type"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_float_type</h1><BR><BR>
            This is a template where is_float_type&lt;T&gt;::value == true when T is
            a floating point type (i.e. float, double, or long double) and false otherwise.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#is_float_type">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="is_function"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_function</h1><BR><BR>
            This is a template where is_function&lt;T&gt;::value == true when T is 
            a function type.  
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#is_function">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="is_graph"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_graph</h1><BR><BR>
            This is a template where is_graph&lt;T&gt;::value == true when T
            is a <a href="containers.html#graph">graph</a> object.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/is_kind.h.html#is_graph">More Details...</a><div class="include_file">#include &lt;dlib/is_kind.h&gt;</div></div></div><a name="is_matrix"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_matrix</h1><BR><BR>
            This is a template where is_matrix&lt;T&gt;::value == true when T
            is a <a href="linear_algebra.html#matrix">matrix</a> object or some kind
            of matrix expression.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/is_kind.h.html#is_matrix">More Details...</a><div class="include_file">#include &lt;dlib/is_kind.h&gt;</div></div></div><a name="is_pair"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_pair</h1><BR><BR>
            This is a template where is_pair&lt;T&gt;::value == true when T
            is a std::pair object.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/is_kind.h.html#is_pair">More Details...</a><div class="include_file">#include &lt;dlib/is_kind.h&gt;</div></div></div><a name="is_pointer_type"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_pointer_type</h1><BR><BR>
            This is a template where is_pointer_type&lt;T&gt;::value == true when T is a pointer 
            type and false otherwise.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#is_pointer_type">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="is_rand"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_rand</h1><BR><BR>
            This is a template where is_rand&lt;T&gt;::value == true when T
            is a <a href="algorithms.html#rand">rand</a> object.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/is_kind.h.html#is_rand">More Details...</a><div class="include_file">#include &lt;dlib/is_kind.h&gt;</div></div></div><a name="is_reference_type"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_reference_type</h1><BR><BR>
            This is a template where is_reference_type&lt;T&gt;::value == true when T is a reference 
            type and false otherwise.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#is_reference_type">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="is_same_object"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_same_object</h1><BR><BR>
            This is a templated function which checks if both of its arguments are actually
            references to the same object.  It returns true if they are and false otherwise.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#is_same_object">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="is_same_type"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_same_type</h1><BR><BR>
            This is a template where is_same_type&lt;T,U&gt;::value == true when T and U are 
            the same type and false otherwise. 
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#is_same_type">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="is_signed_type"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_signed_type</h1><BR><BR>
            This is a template where is_signed_type&lt;T&gt;::value == true when T is
            a signed scalar type and false when it is an unsigned scalar
            type.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#is_signed_type">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="is_std_vector"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_std_vector</h1><BR><BR>
            This is a template where is_std_vector&lt;T&gt;::value == true when T
            is a <a href="containers.html#std_vector_c">std_vector_c</a> or std::vector object.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/is_kind.h.html#is_std_vector">More Details...</a><div class="include_file">#include &lt;dlib/is_kind.h&gt;</div></div></div><a name="is_unsigned_type"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">is_unsigned_type</h1><BR><BR>
            This is a template where is_unsigned_type&lt;T&gt;::value == true when T is
            an unsigned scalar type and false when it is a signed scalar
            type.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#is_unsigned_type">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="noncopyable"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">noncopyable</h1><BR><BR>
            This is a simple class that makes it easy to declare a non-copyable object.
            To use it to make your own class non-copyable just inherit from it.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/noncopyable.h.html#noncopyable">More Details...</a><div class="include_file">#include &lt;dlib/noncopyable.h&gt;</div></div></div><a name="portability_macros"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">portability_macros</h1><BR><BR>        
            This file #defines various macros depending on the platform being compiled under. 
            See the file itself for the specifics.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/platform.h.html">More Details...</a><div class="include_file">#include &lt;dlib/platform.h&gt;</div></div></div><a name="promote"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">promote</h1><BR><BR>
        This is a template that takes one of the built in scalar types and gives you another
        scalar type that should be big enough to hold sums of values from the original scalar 
        type.  The new scalar type will also always be signed.

         <p>
        For example, promote&lt;uint16&gt;::type == int32
         </p><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#promote">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="static_switch"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">static_switch</h1><BR><BR>
        To use this template you give it some number of boolean expressions and it
        tells you which one of them is true.   If more than one of them is true then
        it causes a compile time error.  It is useful for cases where you want to
        specialize a template and you want to specialize it not by
        the type of object it gets per say but instead according to the values of some
        type traits associated with the various template arguments.  A simple example of
        this can be seen in the <a href="imaging.html#assign_pixel">assign_pixel</a>'s
        implementation which can be found at the bottom of the <a href="dlib/pixel.h.html">
        dlib/pixel.h</a> file.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#static_switch">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="tabs"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">tabs</h1><BR><BR>
            This is a template to compute the absolute value a number at compile time.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#tabs">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="tmax"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">tmax</h1><BR><BR>
            This is a template to compute the max of two values at compile time.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#tmax">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="tmin"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">tmin</h1><BR><BR>
            This is a template to compute the min of two values at compile time.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#tmin">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="unsigned_type"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">unsigned_type</h1><BR><BR>
            This is a template that allows you to obtain the unsigned version 
            of any integral type.  For example, unsigned_type&lt;signed short&gt;::type ==
            unsigned short.
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/uintn.h.html#unsigned_type">More Details...</a><div class="include_file">#include &lt;dlib/uintn.h&gt;</div></div></div><a name="wrap_function"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">wrap_function</h1><BR><BR>        
            This is a template that allows you to turn a global function into a 
            function object.  See the specs for more details. 
         <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#wrap_function">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div><a name="_dT"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">_dT</h1><BR><BR>
            This is a macro function for converting a string/character literal to either a char or wchar_t literal. 
   Its form is <tt>_dT(target character type,string or character literal)</tt><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#_dT">More Details...</a><div class="include_file">#include &lt;dlib/algs.h&gt;</div></div></div></div></body></html>