/[svn]/linuxsampler/trunk/src/common/Ref.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/common/Ref.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3766 by schoenebeck, Wed Jun 11 13:24:32 2014 UTC revision 3767 by schoenebeck, Fri May 15 19:28:13 2020 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (c) 2014 Christian Schoenebeck   * Copyright (c) 2014 - 2020 Christian Schoenebeck
3   *   *
4   * http://www.linuxsampler.org   * http://www.linuxsampler.org
5   *   *
# Line 12  Line 12 
12    
13  #include <set>  #include <set>
14  #include <stdio.h>  #include <stdio.h>
15    #if __cplusplus >= 201103L && !CONFIG_NO_CPP11STL
16    # include <type_traits> // for std::enable_if and std::is_same
17    #endif
18    
19  // You may enable this while developing or at least when you encounter any kind  // You may enable this while developing or at least when you encounter any kind
20  // of crashes or other misbehaviors in conjunction with Ref class guarded code.  // of crashes or other misbehaviors in conjunction with Ref class guarded code.
# Line 203  namespace LinuxSampler { Line 206  namespace LinuxSampler {
206              #endif              #endif
207          }          }
208    
209            #if __cplusplus >= 201103L && !CONFIG_NO_CPP11STL
210            template<std::enable_if<!std::is_same<T_BASE, T>::value>* = NULL> // prevent compiler error if T == T_Base (due to method signature duplicate)
211            #endif
212          Ref(const T_BASE* p) : RefBaseT() {          Ref(const T_BASE* p) : RefBaseT() {
213              #if LS_REF_VERBOSE_DEBUG_MSG              #if LS_REF_VERBOSE_DEBUG_MSG
214              printf("Ref base ptr ctor Ref:0x%lx <- p:0x%lx\n", (long long)this, (long long)p);              printf("Ref base ptr ctor Ref:0x%lx <- p:0x%lx\n", (long long)this, (long long)p);
# Line 351  namespace LinuxSampler { Line 357  namespace LinuxSampler {
357              return *this;              return *this;
358          }          }
359    
360            #if __cplusplus >= 201103L && !CONFIG_NO_CPP11STL
361            template<std::enable_if<!std::is_same<T_BASE, T>::value>* = NULL> // prevent compiler error if T == T_Base (due to method signature duplicate)
362            #endif
363          Ref<T,T_BASE>& operator=(const T_BASE* p) {          Ref<T,T_BASE>& operator=(const T_BASE* p) {
364              #if LS_REF_VERBOSE_DEBUG_MSG              #if LS_REF_VERBOSE_DEBUG_MSG
365              printf("Ref base ptr assignment Ref:0x%lx <- p:0x%lx\n", (long long)this, p);              printf("Ref base ptr assignment Ref:0x%lx <- p:0x%lx\n", (long long)this, p);

Legend:
Removed from v.3766  
changed lines
  Added in v.3767

  ViewVC Help
Powered by ViewVC